<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>循环结构</title>
<script>
//金字塔乘法表
for(var n =1; n <10; n++){
for(var m =1;m <=n;m ++){
document.write ("<span>"+(n + "*" + m + "="+(m * n<10?(m * n) +" ":(m * n)+" "))+"</span>")
}
document.write("<br>");
}
</script>
<style>
body {
text-align: center;
}
span {
display: inline-block;
width: 100px;
height: 30px;
text-align: center;
line-height: 30px;
border: 1px solid black;
}
</style>
</head>
<body>
</body>
</html>