Format table headers explicitly (#282)

This commit is contained in:
Jaco
2021-04-24 08:24:54 +03:00
committed by GitHub
parent 4b886dcde3
commit 362ad189bd
+20 -2
View File
@@ -147,12 +147,30 @@
table.appendChild(row);
}
function appendHeader (header) {
const row = document.createElement('tr');
const ab = document.createElement('td');
const c = document.createElement('td');
if (typeof header === 'string') {
ab.appendChild(document.createTextNode(header));
} else {
ab.appendChild(header);
}
ab.colSpan = 2;
row.appendChild(ab);
row.appendChild(c);
table.appendChild(row);
}
function fillAddressList (url, addresses) {
if (addresses && addresses.length) {
const c = document.createElement('h3');
c.appendChild(document.createTextNode(url));
appendRow(c);
appendHeader(c);
addresses.forEach((address) => {
const balance = balances.find(([a]) => a === address) || ['', '']
@@ -198,7 +216,7 @@
countIndex++;
c.appendChild(document.createTextNode(`${thisMonth} (${count[countIndex]})`));
appendRow(c);
appendHeader(c);
prevMonth = thisMonth;
}