forked from ccccourse1/ws110a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9x9.html
44 lines (39 loc) · 895 Bytes
/
9x9.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<style>
table{width: 500px;height: 500px;background-color: rgb(175, 232, 255);border-style: solid;border-width: 3px;border-collapse: collapse;}
th{width: 50px;border-style: solid;border-width: 1px;}
.t{background-color: deepskyblue;border-width: 1px;}
</style>
<body id="9x9">
</body>
<script>
let x = document.getElementById("9x9")
let y = ""
let num=[1,2,3,4,5,6,7,8,9]
y+="<table>"
y += "<tr><th class=t>x</th>"
for (let i of num)
{
y+="<th class=t>"
y+=i
y+="</th>"
}
y+="</tr>"
for (let i of num)
{
y+="<tr>"
y+="<th class=t>"
y+=i
for (let j of num)
{
y+="<th>"
y+=i*j
y+="</th>"
}
y+="</tr>"
}
y+="</table>"
x.innerHTML=y
</script>
</html>