---
# System prepended metadata

title: '99'
tags: [JavaScript]

---

# 99 
###### tags: `JavaScript`
```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>99乘法表</title>
    <style>
        .tb1{
            width: 600px;
            border: 3px solid green;
            border-collapse: collapse;
        }
        
        td{
            border:1px solid red;
            color: blue;
            background-color: yellow;
        }
        th{
            border:1px solid red;
            text-align: center;
            background-color: orange;
        }
    </style>
</head>
<body>
   
    <table class="tb1" >
        <caption><h4>九九乘法表</h4></caption>
        <thread>
            <script>
                document.write("<tr>")
                for(var i=1;i<10;i++){
                    document.write(`<th>${i}</th>`)
                }
                document.write("</tr>")
            </script>
        </thread>
        <tbody>
        <script>
            document.write("<tr>")
            for(var i=1;i<10;i++){
                
                document.write("<td>")
                for(var j=1;j<10;j++){
                    document.write(`${j}*${i}=${j*i}<br>`) 
                }
                
                document.write("</td>")
               
                
            }
            document.write("</tr>")
        </script>
        </tbody>
    </table>
</body>
</html>
```
換寫法
```
<script >
         document.write("<tr>")
        
        for(let i=1 ; i<=9 ; i++){
             
                
            for(let j=1 ; j<=9 ; j++){
                document.write(`<td>${j}*${i}=${i*j}</td>`)
                
            }
            
            document.write("</tr>")
         } 
        
    </script>
```