-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest2.html
112 lines (77 loc) · 2.2 KB
/
test2.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test 2</title>
<script src="https://code.jquery.com/jquery-3.5.1.js">
</script>
</head>
<style>
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}
th:nth-child(even)
{
background-color: #f2f2f2
}
td:nth-child(even){
background-color: #f2f2f2
}
th, td {
text-align: center;
border: solid 1px rgb(78, 74, 74);
padding: 15px;
}
th{
color: rgb(56, 53, 53);
}
</style>
<body>
<h1>Equipment-wise Details</h1>
<table id="table">
<tr>
<th rowspan="2"> MACHINE NAME </th>
<th rowspan="2"> MACHINE ID</th>
<th colspan="3"> ENERGY CONSUMED </th>
<th rowspan="2"> Active Power \n (MW)</th>
<th rowspan="2"> Apparent Power \n (MVA)</th>
<th rowspan="2"> Relative Power \n (MVAr)</th>
<th rowspan="2"> CURRENT (Amps)</th>
<th rowspan="2"> VOLTAGE (Volts)</th>
<th rowspan="2"> POWER FACTOR (Volts)</th>
<th colspan="3"> IDLE TIME </th>
</tr>
<tr colspan="3">
<th> Today</th>
<th> MTD</th>
<th> YTD</th>
<th> Today</th>
<th> MTD</th>
<th> YTD</th>
</tr>
</table>
<script src="data.js"></script>
<SCript>
$(document).ready(function () {
const data=JSON.parse(json);
for(var i=1;i<data.length;i++){
add(data[i]);
}
function add(data) {
var datarow = '';
$.each(data, function (key, value) {
datarow += '<td>';
datarow += value;
datarow += '</td>';
});
$('#table').append("<tr>"+datarow+"</tr>");
}
});
</SCript>
</body>
</html>