python/Day21-30/code/new/web1901/js_practice_1.html

35 lines
643 B
HTML
Raw Permalink Normal View History

2024-12-04 00:04:56 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>乘法口诀表</title>
<style>
table {
border: 730px;
border-collapse: collapse;
margin: 0 auto;
}
td {
border: 1px solid black;
width: 80px;
text-align: center;
}
</style>
</head>
<body>
<script>
+function showTable() {
document.write('<table>')
for (let i = 1; i <= 9; i += 1) {
document.write('<tr>')
for (let j = 1; j <= i; j += 1) {
document.write('<td>')
document.write(`${j}&times;${i}=${j * i}`)
document.write('</td>')
}
document.write('</tr>')
}
}()
</body>
</html>