Skip to content

Commit 3176a39

Browse files
author
Erwin Dondorp
committed
all tables have a column specification
1 parent 2b8cc06 commit 3176a39

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

saltgui/static/scripts/panels/Panel.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,27 +179,26 @@ export class Panel {
179179
addTable (pColumnNames, pFieldList = null) {
180180
const table = Utils.createElem("table", this.key, "", this.key + "-table");
181181

182-
if (pColumnNames) {
183-
const thead = Utils.createElem("thead");
184-
thead.id = this.key + "-table-thead";
185-
const tr = Utils.createTr();
186-
tr.id = this.key + "-table-thead-tr";
187-
188-
for (const columnName of pColumnNames) {
189-
const th = Utils.createElem("th");
190-
let cn = columnName;
191-
if (cn && cn.startsWith("@")) {
192-
cn = cn.substring(1);
193-
}
194-
if (cn && !cn.startsWith("-")) {
195-
th.innerText = cn;
196-
}
197-
tr.appendChild(th);
182+
const thead = Utils.createElem("thead");
183+
thead.id = this.key + "-table-thead";
184+
const tr = Utils.createTr();
185+
tr.id = this.key + "-table-thead-tr";
186+
187+
for (const columnName of pColumnNames) {
188+
const th = Utils.createElem("th");
189+
let cn = columnName;
190+
if (cn && cn.startsWith("@")) {
191+
cn = cn.substring(1);
192+
}
193+
if (cn && !cn.startsWith("-")) {
194+
th.innerText = cn;
198195
}
199-
thead.appendChild(tr);
200-
table.appendChild(thead);
196+
tr.appendChild(th);
201197
}
202198

199+
thead.appendChild(tr);
200+
table.appendChild(thead);
201+
203202
const tbody = Utils.createElem("tbody");
204203
// not needed yet
205204
// tbody.id = this.key + "-table-tbody";

0 commit comments

Comments
 (0)