JS实现九九乘法表
效果图:
代码:
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>九九乘法表</title> <style type="text/css"> td{ border: 1px solid black; box-sizing: border-box; } </style> </head> <body> <script type="application/javascript"> document.write("<table cellspacing='10'>") for(var i=1;i<=9;i++){ document.write("<tr>") for(var j=1;j<=i;j++){ document.write('<td>'+j+'x'+i+'='+i*j+"</td>"); } document.write("</tr>") } document.write("</table>") </script> </body> </html>
.