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() {