-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (41 loc) · 914 Bytes
/
Copy pathscript.js
File metadata and controls
43 lines (41 loc) · 914 Bytes
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
let allCards = document.querySelector('.allCards');
let personData = [{
Name: "Azhar",
rollNo: 11,
address: "Ghulkin"
},
{
Name: "Musharaf",
rollNo: 12,
address: "Ghulkin"
},
{
Name: "Ahsam",
rollNo: 13,
address: "Ghulkin"
},
{
Name: "Masroor",
rollNo: 14,
address: "Ghulkin"
},
];
const personList = personData.map((data) => {
return `
<div>
<table>
<tr>
<th>Name</th>
<th>Roll Number</th>
<th>Address</th>
</tr>
<tr>
<td>${data.Name}</td>
<td>${data.rollNo}</td>
<td>${data.address}</td>
</tr>
</table>
</div>
`
});
allCards.innerHTML = personList.join(' ');