zoukankan      html  css  js  c++  java
  • 前端学习笔记之99乘法表

     
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            #time {
                font-size: 200px;
                text-align: center;
                color: deeppink;
            }
            p {
                 100px;
                text-align: left;
                display: inline-block;
                padding: 10px;
                margin: 0px;
                font-size: 18px;
                background-color: lightcoral;
                border-top: 1px solid #cccccc;
                border-right: 1px solid #cccccc;
            }
            div {
                display: block;
            }
            #multiplication {
                /*  auto; */
                display: inline-block !important;
                display: inline;
                border-left: 1px solid #cccccc;
                border-bottom: 1px solid #cccccc;
            }
        </style>
    </head>
    <body>
        <h1>9*9乘法表</h1>
        <div id="multiplication"></div>
    </body>
    <script>
        window.onload = function () {
            for (let i = 1; i <= 9; i++) {
                document.getElementById("multiplication").innerHTML += "<div></div>";
                for (let j = 1; j <= i; j++) {
                    document.getElementById("multiplication").getElementsByTagName("div")[i - 1].innerHTML += "<p>" + j + "x" + i + "=" + (j * i) + "</p>"
                }
            }
        }
    </script>
    </html>
  • 相关阅读:
    Easy File Sharing Web Server 7.2
    我的安全之路——二进制与逆向篇
    下拉滚动,导航条悬停在顶部
    Java-json对象转Map
    Java-验证码生成(数字+字母)
    Java-List分页工具
    HDU-1556-Color the ball (线段树和差分数组两种解法)
    牛客练习赛34-C-little w and Segment Coverage(差分数组)
    牛客练习赛34-C-little w and Segment Coverage(差分数组)
    差分数组原理及应用
  • 原文地址:https://www.cnblogs.com/Yangyecool/p/13171669.html
Copyright © 2011-2022 走看看