练习9*9乘法表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>99乘法表</title> <style> td{ border:1px solid; } </style> <script> //完成表格嵌套 document.write("<table align='center'>"); //循环一到就 for (var i = 1; i <= 9; i++) { document.write("<tr>"); //循环一到就 for (var j = 1 ; j <=i ; j++) { document.write("<td>"); //打印格式i*j=? 需要让两个循环相乘 document.write(j + "*" + i + "=" + (i*j) +" "); document.write("</td>"); } // 输出 document.write("</tr>"); } document.write("</table>") </script> </head> <body> </body> </html>
标签:write,练习,616Javascript,99,document,乘法表 From: https://www.cnblogs.com/agzq/p/16821758.html