<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script type="text/javascript"> var a = 1; var b = 1; var str = "<table width=‘500px‘ height=‘200px‘ cellspacing=‘10‘>"; while (a<10) { str += "<tr>" while(b<=a){ str += "<td>"+b+"×"+a+"="+(a*b)+"</td>" b++ } str += "</tr>" a++ b =1; } str += "</table>" document.write(str); </script> </body> </html>
时间: 2024-10-08 14:53:40