INNER CODE UNIT · JavaScript
dataTable
rootSunc/CNEquity · frontend/src/main.js:190
function dataTable(cols, rows, empty, cls = "") {
const head = cols
.map((c) => (typeof c === "string" ? { h: c } : c))
.map((c) => `<th${c.n ? ' class="n"' : ""}>${esc(c.h)}</th>`)
.join("");
const body = rows.length
? rows.join("")
: `<tr><td colspan="${cols.length}" class="empty-table"><span>${empty}</span></td></tr>`;
return `<div class="scroll"><table${cls ? ` class="${cls}"` : ""}><thead><tr>${head}</tr></thead><tbody>${body}</tbody></table></div>`;
}
/** Load-bearing prose, not a footnote.
*
* The quality panels carry the two sentences most likely to be read backwards
* `no_overlap` is "nothing comparable", not "agrees", and quarantine is
* evidence, not a bin. They were set as small grey text under the header and
* read as boilerplate. */
const panelNote = (html) => `<p class="panel-note">${html}</p>`;