«

九九乘法表

时间:2023-4-15 09:42     作者:小诸葛     分类: JavaScript     正在检查是否收录...


九九乘法表

代码

<!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>九九乘法表</title>

    <style>
        body {
            background-color: #000;
        }

        div {
            display: inline-block;
            text-align: center;
            width: 100px;
            height: 50px;
            line-height: 50px;
            border: 1px solid #ffffff;
            color: #fff;
            margin: 3px;
            font-weight: bold;

        }

        div:hover {
            background-color: #fff;
            color: #000;
        }
    </style>
</head>

<body>
    <script>
        for (i = 1; i <= 9; i++) {
            for (j = 1; j <= i; j++) {
                document.write(`<div>${j}*${i}=${j * i}</div>`)
            }
            document.write("<br/>")

        }
    </script>
</body>

</html>

九九乘法表

推荐阅读:


扫描二维码,在手机上阅读