首页 > 代码库 > 九九乘法表

九九乘法表

技术分享
 1 <!DOCTYPE html>
 2 <html>
 3 <head lang="en">
 4     <meta charset="UTF-8">
 5     <title>九九乘法表</title>
 6     <script src="http://www.mamicode.com/js/angular.js" type="text/javascript"></script>
 7 </head>
 8 <body>
 9 </body>
10 <script type="text/javascript">
11 
12     document.write(‘<table border="1" bgcolor="#ccc" width="80%" cellpadding="0" cellspacing="0">‘);
13 
14     for(var i=1;i<=9;i++){
15 
16         document.write(‘<tr>‘);
17 
18         for(var j=1;j<=i;j++){
19 
20             document.write(‘<td>‘+j+‘x‘+i+‘=‘+(i*j)+‘</td>‘);
21 
22         }
23 
24         document.write(‘</tr>‘);
25 
26     }
27 
28     document.write(‘</table>‘);
29 
30 </script>
31 
32 
33 </html>
View Code

效果图:

技术分享

九九乘法表