<table id="table1" align="center" border="1" width="200">
<tr>
<td><a href="javascript:AddRow('新数据');">AddRow</a></td>
</tr>
</table>
<script language="javascript">
function AddRow(data){
var thetable=document.all("table1");
newrow=thetable.insertRow(0);
newcell=newrow.insertCell();
newcell.innerText=data;
}
</script>
<tr>
<td><a href="javascript:AddRow('新数据');">AddRow</a></td>
</tr>
</table>
<script language="javascript">
function AddRow(data){
var thetable=document.all("table1");
newrow=thetable.insertRow(0);
newcell=newrow.insertCell();
newcell.innerText=data;
}
</script>
解决方案 »
- 求助!jqGrid浮动窗口的字体怎么设置大小?
- JS获取IE的外部高度和宽度
- js 上传图片前,预览图片
- IE浏览器的后退事件,JS问题
- ie下动态插入iframe,不能对其编辑模式修改和改变其html
- 有关JavaScript代码规范的问题......
- 关于select.options[i].selected值得该表
- form提交后打开新窗口的焦点问题
- 如何让表单提交后,保持原来的页面,并且不会跳出新的页面来?高手请进!
- 微软网站的菜单程序
- 懂javascript的过来看段代吗。我怎么看不明白啊。
- 如何为JS自定义类写一个初始化时执行的函数?(类似VBS的Class_Initialize功能)
theTable = document.getElementById("myTABLE");
theTableBody = theTable.tBodies[0];newRow = theTableBody.insertRow(-1);
newCell = newRow.insertCell(0);
newCell.style.width="25%";
newCell.style.height="10";
newCell.innerText = "插入的内容";