九九乘法表
table{ border-collapse: collapse; }
table td{ border: 1px solid #ccc;padding: 3px 6px; }
var str = '
for(var i = 1;i <= 10;++ i){
str += '
';for(var j = 1;j <= i;++ j ){
str += '
'+ j + '*' + i + '=' +( j*i )+'';}
str += '
';}
str += '
document.getElementById('table').innerHTML = str;
document.write("
for(var i = 1; i < 10;i++){
document.write("
");for(var j = 1 ; j <= i ; j++){
document.write("
");document.write(j+"*"+i+"="+i*j);
document.write("
");}
document.write("
");}
document.write("
");本文地址:https://blog.csdn.net/gcyqweasd/article/details/107574702