From 1a214bf8c5b8d755e81a1742cf7600d7dc6aa2ca Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 14 Mar 2022 02:43:23 +0000 Subject: [PATCH] UITable: Add h3 --- src/static/js/ui/UITable.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/static/js/ui/UITable.mjs b/src/static/js/ui/UITable.mjs index bd52adf..495d043 100644 --- a/src/static/js/ui/UITable.mjs +++ b/src/static/js/ui/UITable.mjs @@ -12,15 +12,18 @@ class UITable extends AbstractUIItem { this.emel = new Emel().emel; + const preamble = `h3{${def.name}}`; + let result; switch(typeof def.content) { case "string": - this.el.replaceChildren(this.emel(`table>(thead>tr>th{Peer}+th{Value})+tbody`)) + result = this.emel(`${preamble}+table>(thead>tr>th{Peer}+th{Value})+tbody`); break; default: - this.el.replaceChildren(this.emel(`table>(thead>tr>th{Peer}+${ + result = this.emel(`${preamble}+table>(thead>tr>th{Peer}+${ Object.keys(def.content).map(header => `th{${header}}`).join("+") - })+tbody`)); + })+tbody`); } + this.el.replaceChildren(result); } clear() {