Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到了问题,我需要使用用户指定的行数和列数(从下拉列表中)生成一个表。当用户选择他们想要的行数和列数时,我在弄清楚如何让表格正常工作时遇到问题。帮助!我已经创建了一个表单和两个选择列表,但我不能
在给定行数和列数的情况下构建表非常简单
var table = document.createElement('table'); for (var i = 0; i < rowcount; i++){ var row = table.insertRow(i); for (var j = 0; j < columncount; j++){ row.insertCell(j); } }
演示