DataTableHeader

constructor(key: String, title: String = "", value: (T) -> Any?? = null, sortable: Boolean = true, width: Dp? = null, align: TextAlign = TextAlign.Start, fixed: Boolean = false, visible: Boolean = true, maxLines: Int = Int.MAX_VALUE, overflow: TextOverflow = TextOverflow.Clip, comparator: <Error class: unknown class><T>? = null, children: List<DataTableHeader<T>>? = null, headerContent: @Composable () -> Unit? = null, cellContent: @Composable (T) -> Unit? = null)(source)

Parameters

key

Stable unique identifier for this column. Also used for sorting.

title

Text label shown in the default header when headerContent is not provided.

value

Extractor invoked for each row item to produce a displayable value.

sortable

Whether this column supports sorting via the built-in header interactions.

width

Fixed width for the column. If null, the column is laid out with weight to fill space.

align

Horizontal alignment for header text and default cell text.

fixed

When true, the column is frozen (pinned) to the left and does not scroll horizontally. Frozen columns must have an explicit width; DataTable throws if one does not.

visible

When false, the column is excluded from rendering. Defaults to true.

maxLines

Maximum lines for default text rendering. Defaults to Int.MAX_VALUE.

overflow

Text overflow strategy for default text rendering.

comparator

Optional custom comparator for sorting. When provided, takes precedence over the default Comparable-based sort.

children

Optional nested headers. When provided, this header becomes a group: it is drawn as a band above its children, spanning them, and only the leaf headers render as actual columns. A group's own value, width, and sorting settings are ignored — it takes its width from the leaves beneath it, which must be either all fixed-width or all weighted.

headerContent

Optional composable to fully customize the header cell for this column.

cellContent

Optional composable to fully customize each body cell for this column.