forked from datacode-in/Hacktoberfest-Indore-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (30 loc) · 802 Bytes
/
index.js
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
window.onload = function () {
fetch("./data.json")
.then((response) => response.json())
.then((profiles) => {
new gridjs.Grid({
columns: [
{
name: "Image",
formatter: (cell) =>
gridjs.html(`<img height="80" width="80" src="${cell}"/>`),
},
{
name: "Github",
formatter: (cell) =>
gridjs.html(
`<a href="https://github.com/${cell}" target="_blank">${cell}</a>`
),
},
"Firstname",
"Lastname",
"About",
],
data: profiles.data,
className: {
table: "table-body",
},
}).render(document.getElementById("table"));
})
.catch((err) => console.log(err));
};