-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.html
38 lines (36 loc) · 1000 Bytes
/
table.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Graph matrix</title>
<script src="./node_modules/jquery/dist/jquery.js"></script>
<style>
#matrix {
border: 1px solid #000000;
border-collapse: collapse;
}
#matrix td {
border: 1px solid black;
padding: 5px;
text-align: center;
vertical-align: center;
}
</style>
</head>
<body>
<table id="matrix"></table>
<script>
$(document).ready(function () {
var matrix = JSON.parse(localStorage.getItem("getGraphMatrix"));
var table = $("#matrix");
for (var i = 0; i < matrix.length; i++) {
var row = $("<tr></tr>").appendTo(table);
console.log(row);
for (var j = 0; j < matrix[0].length; j++) {
row.append("<td>" + matrix[i][j] + "</td>");
}
}
});
</script>
</body>
</html>