编写一个函数,在页面上输出一个N行M列的表格,表格内容填充1~100的随机数字

编写一个函数,在页面上输出一个N行M列的表格,表格内容填充1~100的随机数字

function tab(n,m){
document.write("<table border=1>");
for(var i=1;i<=n;i++){
document.write("<tr>");
for(var j=1;j<=m;j++){
document.write("<td>");
document.write(numRandom(1,100));
document.write("</td>");
}
document.write("</tr>");
}

document.write("</table>");
}

btn.onclick = function(){
var rowVal = row.value;
var colVal = col.value;
tab(rowVal,colVal);
}

原文地址:https://www.cnblogs.com/BLOGZR/p/9446279.html