下面的图片就是我今晚写的代码,不知道为什么出不来

解决方案 »

  1.   

    不明白你的xy哪里来的???
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
        <style>
            table{
                width:1000px;
            }
        </style>
    </head>
    <body>
        <script>
            document.write('<table>');
            for (var i = 9; i > 0; i--) {
                document.write('<tr>');
                for (var j = 1; j < 10; j++) {
                    if (j <= i) {
                        document.write('<td>' + i + '*' + j + '=' + i * j + '</td>');
                    } else {
                        document.write('<td></td>')
                    }
                }
                document.write('</tr>');
            }
            document.write('</table>');
        </script>
    </body>
    </html>
      

  2.   

    谢谢了,当时没注意,xy就是ij