Skip to content

TableColumn

Defined in: src/widgets/data/table.ts:28

A Table column: how to read, size, render, and sort one field.

Row = any

optional align?: "left" | "right" | "center"

Defined in: src/widgets/data/table.ts:45

Cell text alignment.


optional cell?: (row, rowIndex) => string

Defined in: src/widgets/data/table.ts:49

Text accessor for a cell. Defaults to String(row[key]).

Row

number

string


optional compare?: (a, b) => number

Defined in: src/widgets/data/table.ts:58

Custom comparator; defaults to numeric/locale comparison of the sort value.

Row

Row

number


header: string

Defined in: src/widgets/data/table.ts:32

Header label.


key: string

Defined in: src/widgets/data/table.ts:30

Stable identifier; also the default data accessor (row[key]).


optional maxWidth?: number

Defined in: src/widgets/data/table.ts:43

Maximum column width in cells.


optional minWidth?: number

Defined in: src/widgets/data/table.ts:41

Minimum column width in cells.


optional render?: (row, rowIndex) => unknown

Defined in: src/widgets/data/table.ts:56

Renders a widget-bearing cell instead of text. Returns a framework node (e.g. a React element); only visible rows are materialized. Typed as unknown here to keep the widget layer framework-neutral — the React <Table> narrows it.

Row

number

unknown


optional sortable?: boolean

Defined in: src/widgets/data/table.ts:47

Whether clicking the header toggles sorting on this column.


optional width?: string | number

Defined in: src/widgets/data/table.ts:39

Column width:

  • number — fixed cell count
  • "<n>fr" — flexible, shares leftover space proportionally
  • "auto" (or omitted) — sized to the widest visible cell