99乘法表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <script> document.write('<table border="1" width="800" align="center">'); for (var row = 9; row > 0; row--) { document.write('<tr>') for (var col = 1; col <= row; col++) { var str = col + 'x' + row + '=' + (row * col); document.write('<td>' + str + '</td>'); } document.write('<tr/>'); } document.write('</table>'); </script> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例