动态创建表格
2012-06-14 13:39
218 查看
<script type="text/javascript"> var table = document.createElement("table"); table.border = 1; table.width = "100%"; var tbody = document.createElement("tbody"); table.appendChild(tbody); tbody.insertRow(0); tbody.rows[0].insertCell(0); tbody.rows[0].cells[0].appendChild(document.createTextNode("Cell 1,1")); tbody.rows[0].insertCell(1); tbody.rows[0].cells[1].appendChild(document.createTextNode("Cell 1,1")); tbody.insertRow(1); tbody.rows[1].insertCell(0); tbody.rows[1].cells[0].appendChild(document.createTextNode("Cell 1,1")); tbody.rows[1].insertCell(1); tbody.rows[1].cells[1].appendChild(document.createTextNode("Cell 1,1")); </script>
相关文章推荐
- 使用Javascript动态创建表格,不同的方法,巨大的运行时间差异!
- for循环动态创建表格
- js动态创建表格
- ExtJs中根据后台数据动态创建表格列及其数据
- js动态创建,删除表格
- 创建含有按钮的动态表格(php+js+jquery+DOM)
- js动态创建表格,删除行列的小例子
- Dom编程(动态创建 表格、删除行、删除列)
- 动态创建表格--只限于一次点击
- javascript 动态创建表格:新增、删除行和单元格
- JS动态创建表格
- 使用JS动态创建含有1000行的表格
- javascript动态创建表格:新增、删除行和列
- js创建表格动态增加行并删除行
- DHTML技术演示---动态创建表格、删除表格(详细的解释,适合初学者)
- 创建动态表格(节点创建以及表格隔行变色)
- 将给定的数据动态加入到创建的表格中
- C#动态创建一个表格
- JQuery动态创建表格
- js动态创建表格