Skip to content

Commit

Permalink
updated demo
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Mar 19, 2022
1 parent 0e74f17 commit 4e963a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,19 @@ <h1>Zonal Demo</h1>
// include_zero_count = false
});

const columns = Object.keys(table[0]);
console.log(columns);
// add header
const table_element = document.getElementById("results-table");
const thead = document.createElement("THEAD");
columns.forEach(col => {
table.columns.forEach(col => {
const th = document.createElement("TH");
th.innerText = col;
thead.appendChild(th);
});
table_element.appendChild(thead);

table.forEach(row => {
table.rows.forEach(row => {
const tr = document.createElement("TR");
columns.map(column => {
table.columns.map(column => {
const td = document.createElement("TD");
const value = row[column];
td.textContent = value === null ? "null" : value;
Expand Down

0 comments on commit 4e963a6

Please sign in to comment.