From 362ad189bd348b7363b73c1f077451e9d548824a Mon Sep 17 00:00:00 2001 From: Jaco Date: Sat, 24 Apr 2021 08:24:54 +0300 Subject: [PATCH] Format table headers explicitly (#282) --- index.html | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2ad75787a..2d7b2dc08 100644 --- a/index.html +++ b/index.html @@ -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; }