<style>
td {
width: 100px;
height: 100px;
border: 1px solid;
}
</style>
</head>
<body>
<script>
//用函数自动生成表格
//row为行
//col为列
function tab(row, col) {
var str = `<table>`;
for (var i = 0; i < row; i++) {
str += `<tr>`;
for (var j = 0; j < col; j++) {
str += `<td></td>`;
}
str += `</tr>`
}
str += `</table>`;
document.write(str);
}
tab(Number(prompt('生成几行')), Number(prompt('生成几列')));
</script>
</body>
12-10
05-25
9214