TableColumn
Defined in: components/table.ts:8
One column of a table.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”label?
Section titled “label?”
optionallabel?:Slot
Defined in: components/table.ts:10
The column’s heading.
field?
Section titled “field?”
optionalfield?: keyofT&string
Defined in: components/table.ts:19
The field of the row this column shows. Without a cell, the cell is this field’s value, as text.
The user sorts on it by tapping the column’s heading: once from low to high, again the other way around. A list that is loaded has that for the fields, and the ways around, it has a loader for.
optionalcell?: (row) =>string|number|void
Defined in: components/table.ts:26
Draws the row’s cell in this column. Return a string or number to have it shown as plain text, or draw anything you like into the cell and return nothing. It runs in a reactive scope of its own, so a change to what it reads redraws this one cell. Defaults to showing the field.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”string | number | void
group?
Section titled “group?”
optionalgroup?:boolean| ((row) =>string|number)
Defined in: components/table.ts:34
Groups the rows while they are sorted on this column’s
field: a heading row naming the group comes
before its first row. true groups rows by the field’s value; a
function returns the name of a row’s group — the month of its date,
say.
align?
Section titled “align?”
optionalalign?:"center"|"start"|"end"
Defined in: components/table.ts:39
Which side the cell’s content keeps to. "end" is the one for numbers:
they line up on their last digit, as every figure in a table is tabular.
width?
Section titled “width?”
optionalwidth?:string
Defined in: components/table.ts:45
The column’s width, as a CSS grid track: "8rem", "2fr", "auto"
(as wide as the widest cell drawn). Defaults to an equal share of the
width, "minmax(0, 1fr)". Text that doesn’t fit ends in an ellipsis.