import {html} from "htl"; import {arrayify, maybeColumns} from "./array.js"; import {length} from "./css.js"; import {formatDate, formatLocaleAuto, formatLocaleNumber} from "./format.js"; import {newId} from "./id.js"; import {identity} from "./identity.js"; import {defined, ascending, descending} from "./sort.js"; const rowHeight = 22; export function table(data, options = {}) { const { rows = 11.5, // maximum number of rows to show height, maxHeight = height === undefined ? (rows + 1) * rowHeight - 1 : undefined, width = {}, // object of column name to width, or overall table width maxWidth } = options; const id = newId(); const root = html`