TableColumnsState

Column layout of one table: the order columns render in, the width overrides that apply to them, and the measurements the auto-fit works from.

Reached as TableState.columns. Every member here has a deprecated forwarder on TableState itself, kept for one release so existing call sites compile with a warning that names the replacement; the forwarders go away in the next major.

Properties

Link copied to clipboard

Whether automatic width fitting has been applied for the first data batch render.

Link copied to clipboard

Whether automatic width fitting has been applied for the empty (header-only) state.

Link copied to clipboard

Tracks the maximum measured minimal content width per column across visible rows. Used to auto-fit columns on demand.

Link copied to clipboard

Tracks header widths separately. These are preserved during auto-width recalculation and used as base values after reset.

Link copied to clipboard

Column keys in render order.

Link copied to clipboard

Width overrides per column. A missing key falls back to the spec width, then the default.

Functions

Link copied to clipboard
fun fitToContent(column: C)

Set the column width override to the tracked maximum minimal content width (if available). No-op if no measured width is present for the column.

Link copied to clipboard
fun move(fromIndex: Int, toIndex: Int)

Move a column from fromIndex to toIndex within the current order. Indices are validated; dropping after the last element is supported.

Link copied to clipboard

Recalculate auto-widths for columns with autoWidth enabled.

Link copied to clipboard
fun resize(column: C, action: ColumnWidthAction)

Apply a width action for a column (set or reset override).

Link copied to clipboard
fun resolveWidth(key: C, spec: ColumnSpec<*, C, *>? = null): Dp

Resolves the effective width for a column given its key and optional spec.

Link copied to clipboard
fun setOrder(newOrder: List<C>)

Replace current column order with newOrder. Missing keys are ignored; unknown keys appended.

Link copied to clipboard
fun setWidths(newWidths: Map<C, Dp?>)

Apply external newWidths in bulk. Null width removes the override for that column.

Link copied to clipboard
fun updateMaxContentWidth(column: C, width: Dp, source: String)

Update the tracked maximum minimal content width for a column. If the provided width is greater than the stored value, it will be recorded.