创建一个简单的乘法表

问题描述:

这是我编写的代码,包含在HTML文档中:

Here's the code i've written, which is included in a HTML document:

<script type="text/javascript">
var cipars = 10;
var i =0;
document.write('<table border="1" cellspacing="0" id="Tabula">');
for (i=1; i<10; i++) {
for (j=1; j<10; j++) {
document.write("<tr><td>" + i + " x " + j + " = " + j*i + "</td></tr>");    
}
}
document.write("</table>");
</script>

我的代码现在要做的是使乘法列比表更多.谁能给我一个提示,如何使它...更像一张桌子吗?我已经尽力解释了这个问题.

What my code does now is that makes a multiplication column more than a table. Can anyone give me a hint how to make it... More like a table? I've explained the problem as good as I can.

将其更改为此:

js

var cipars = 10;
var i =0;
document.write('<table border="1" cellspacing="0" id="Tabula">');
for (i=1; i<10; i++) {
    document.write("<tr>");
for (j=1; j<10; j++) {
    document.write("<td>" + i + " x " + j + " = " + j*i + "</td>");    
}
   document.write("</tr>");            
}
document.write("</table>");