UITable: Add h3

This commit is contained in:
Starbeamrainbowlabs 2022-03-14 02:43:23 +00:00
parent e21d6ffc37
commit 1a214bf8c5
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

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