-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
53 lines (49 loc) · 1.89 KB
/
index.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
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="Student.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
</head>
<body>
<h1>Quan Ly Hoc Sinh</h1>
<table border="1" width="100px" style="border-collapse: collapse" class="table">
<tr>
<td>STT</td>
<td>Name</td>
<td>Age</td>
</tr>
<tbody id="drawTable"></tbody>
</table>
<script>
let std1 = new Student(1, "Phong", 22);
let std2 = new Student(2, "Quan", 30);
let std3 = new Student(3, "Khai", 18);
let studentList = [];
studentList.push(std1);
studentList.push(std2);
studentList.push(std3);
function showList() {
let drawTable = "";
for (let i = 0; i < studentList.length; i++) {
drawTable += `<tr><td>${studentList[i].id}</td>
<td>${studentList[i].name}</td>
<td>${studentList[i].age}</td></tr>`
}
document.getElementById("drawTable").innerHTML = drawTable;
}
showList();
</script>
</body>
</html>