<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>九九乘法表</title>
<style>
td{
border: 1px solid;
}
</style>
</head>
<body>
<script>
// 打印9*9乘法表
document.write("<h3>"+"九九乘法表"+"</H3>")
document.write('<table cellspacing="0" style="width: 630px;">');//添加table开始标签
for(var i =1;i<=9;i++){
document.write('<tr style="width:70px; height: 30px;">');//添加tr开始标签
for(var j=1;j<=i;j++){
document.write("<td align='center'>"+i+"*"+j+"="+i*j+"</td>");//让其在td标签中显示
}
document.write("</tr>")//添加tr结束标签
}
document.write('</table>');//添加table结束标签
document.write('</div>');
</script>
</body>
</html>
JS javascript打印99乘法表
最新推荐文章于 2024-04-07 03:24:03 发布