JS九九乘法表

来一个老生常谈的话题--九九乘法表,哈哈,好久不写了呢

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        th{
            border: #ccc 1px solid;
            font-weight: normal;
        }
    </style>
</head>
<body>
<script>
    document.write('<table>');

    for(var i = 0; i <= 9; i++){

        document.write('<tr>');

        for(var j = 1; j <= i; j++){

            document.write('<th>' + j + '*' + i + '=' + ( j * i )+ '</th>');

        }

        document.write('</tr>');

    }

    document.write('</table>');

</script>
</body>
</html>

 

posted @ 2016-02-29 13:58  兜兜里有糖哦  阅读(375)  评论(0编辑  收藏  举报