JavaScript如何创建一个table表格,程序代码如下所示:
var row; var cell; for (var i = 0; i < 10; i++) { row = document.createElement("tr"); document.getElementById("table").appendChild(row); for (var j = 0; j < 10; j++) { cell = document.createElement("td"); cell.innerHTML = "单元格内容"; row.appendChild(cell); } }