Table¶
@Composable
fun Table(
columns: List<TableColumn>,
modifier: Modifier = Modifier,
columnSpacing: Int = DEFAULT_COLUMN_SPACING,
rowSpacing: Int = DEFAULT_ROW_SPACING,
content: TableScope.() -> Unit
)
A grid whose columns size themselves to their widest cell, so entries line up down the page.
The point over a Column of pre-formatted lines - "12 x Iron Ingot" and friends - is that every column is measured across all rows before anything is placed, so numbers right-aligned into their own column share an edge no matter how many digits each has. A line of text cannot do that without the caller padding strings by hand against a proportional font.
Cells are ordinary composables, not strings: an icon, a progress bar and a label are all equally valid contents.
Sizes to its content rather than filling its parent. Wrap it in a net.kernelpanicsoft.archie.gui.composables.containers.Scrollable for a body that may outgrow the room available.
Parameters¶
-
columns: The column specs, left to right. Determines how many cells a row may hold.
-
content: Declares the rows, in order, via
TableScope.row.