<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>九九乘法表</title>
</head>
<body>
<script>
var tab = document.createElement("TABLE");
tab.style.border = "1px solid black";
tab.style.borderCollapse="collapse";
for(var i = 1; i <=9 ; i++){
var tr = document.createElement("TR");
tab.appendChild(tr);
for(var j = 1,str=""; j<=i ; j++){
str=j+"x"+i+"="+i*j+" ";
var td = document.createElement("TD");
td.style.border = "1px solid black";
td.style.height = "20px";
td.innerHTML=str;
tr.appendChild(td);
}
document.body.appendChild(tab);
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>九九乘法表</title>
</head>
<body>
<script>
var tab = document.createElement("TABLE");
tab.style.border = "1px solid black";
tab.style.borderCollapse="collapse";
for(var i = 1; i <=9 ; i++){
var tr = document.createElement("TR");
tab.appendChild(tr);
for(var j = 1,str=""; j<=i ; j++){
str=j+"x"+i+"="+i*j+" ";
var td = document.createElement("TD");
td.style.border = "1px solid black";
td.style.height = "20px";
td.innerHTML=str;
tr.appendChild(td);
}
}
document.body.appendChild(tab);
</script>
</body>
</html>