<script type="text/javascript">
/*
九九乘法表
*/
document.write("<table>");
let result;
for (let i = 1; i <= 9; i++) {
document.write("<tr>");
for (let j = 1; j <= i; j++) {
result = i * j;
document.write("<td>"+j + "X" + i + "=" + result + " "+"</td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
<hr/>
<script type="text/javascript">
document.write("<table>");
let result2;
for (let i = 9; i >0; i--) {
document.write("<tr>");
for (let j = 1; j <= i; j++) {
result2 = i * j;
document.write("<td>"+j + "X" + i + "=" + result2 + " "+"</td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>