JavaScript 制作课程表

JavaScript 制作课程表


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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript制作课程表</title>
<style type="text/css">
table {
border: 2px solid #7FFFD4;
border-radius: 5px;
}

td {
border: 1px solid #D2B48C;
text-align: center;
border-radius: 5px;
}
</style>
</head>
<body>
<script type="text/javascript">
var arr = [
["", "第一节", "第二节", "第三节"],
["星期一", "德育", "JavaScript", "JavaScript"],
["星期二", "JavaScript", "体育", "HTML5"],
["星期三", "Photoshop", "Photoshop", "大扫除"],
["星期四", "HTML5", "HTML5", "自习"],
["星期五", "PHP", "PHP", "PHP"]
];
document.write("<table>");
for (var i = 0; i < arr.length; i++) {
document.write("<tr>");
for (var j = 0; j < arr[i].length; j++) {
document.write("<td>", arr[i][j], "</td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
</body>
</html>