Skip to content

Instantly share code, notes, and snippets.

@itochan
Created November 1, 2019 08:47
Show Gist options
  • Save itochan/61e1e2626ec2d54a85e71ba66aba6ea2 to your computer and use it in GitHub Desktop.
Save itochan/61e1e2626ec2d54a85e71ba66aba6ea2 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>演習 時間割表を二次元配列で</title>
<script src="sugoi_timetable.js"></script>
</head>
<body>
<h1>すごい時間割</h1>
<input type="button" value="時間割を見る" onclick="showTimetable();">
<ul id="timetable"></ul>
</body>
</html>
function showTimetable() {
var dayOfWeek = ["月", "火", "水", "木", "金"];
var timetable = [
[ // 月曜日
"",
"",
"空を飛ぶ(聴講)",
"",
"日本研究概論1",
""
],
[ // 火曜日
"",
"",
"",
"",
"",
""
],
[ // 水曜日
"",
"",
"",
"",
"",
""
],
[ // 木曜日
"",
"データ・ドリブン社会の創発と戦略(聴講)",
"インターネット(聴講)",
"村井・中澤合同研講義",
"村井・中澤合同研講義",
"村井研Archミーティング"
],
[ // 金曜日
"",
"都市システム論",
"インドネシア文化論",
"情報基礎2(SA)",
"情報基礎2(SA)",
""
],
];
var timetableElement = document.getElementById("timetable");
for(var i = 0; i < timetable.length; i++) {
for (var j = 0; j < timetable[i].length; j++) {
var period = j + 1;
timetableElement.innerHTML += "<li>" + dayOfWeek[i] + period + "限: " + timetable[i][j] + "</li>";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment