-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.html
48 lines (44 loc) · 1.65 KB
/
admin.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<div class="container">
<table class="table table-dark table-striped table-hover" id="myTable">
<thead>
<tr>
<th>Sr No.</th>
<th>Email</th>
<th>Password</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
var userDetailsJSON = localStorage.getItem("userDetails");
var userDetails = userDetailsJSON ? JSON.parse(userDetailsJSON) : [];
var tableBody = document.getElementById("myTable").getElementsByTagName("tbody")[0];
let i = 1;
userDetails.forEach((user) => {
var newRow = tableBody.insertRow(tableBody.rows.length);
var srno = newRow.insertCell(0)
var emailCell = newRow.insertCell(1);
var passwordCell = newRow.insertCell(2);
var nameCell = newRow.insertCell(3);
srno.textContent = i++;
emailCell.textContent = user.emailId;
passwordCell.textContent = user.password;
nameCell.textContent = user.name;
});
</script>
</body>
</html>