StylishTable

fun StylishTable(columns: List<String>, rows: List<List<String>>, modifier: Modifier = Modifier, containerColor: Color = MaterialTheme.colorScheme.surfaceContainerHigh, headerContainerColor: Color = MaterialTheme.colorScheme.surfaceContainerHighest, contentColor: Color = MaterialTheme.colorScheme.onSurface, headerTextStyle: TextStyle = MaterialTheme.typography.labelLarge, cellTextStyle: TextStyle = MaterialTheme.typography.bodyMedium, rowSpacing: Dp = 0.dp, cellPadding: PaddingValues = PaddingValues(horizontal = 12.dp, vertical = 10.dp), shape: Shape = RoundedCornerShape(DefaultStylishDimensions.connectedCornerRadius))

A simple read-only data table — the web "Table" pattern from shadcn/ui and MUI.

Renders columns as a header row and rows as body rows with equal cell widths. Rows with fewer cells than columns are padded with empty cells. For interactive, selectable rows prefer the connected list-item family.

Parameters

columns

The column headers.

rows

The cell values; each row must not exceed columns in length.

modifier

Modifier applied to the root surface.

containerColor

Background of the table. Defaults to MaterialTheme.colorScheme.surfaceContainerHigh.

headerContainerColor

Background of the header row. Defaults to MaterialTheme.colorScheme.surfaceContainerHighest.

contentColor

Foreground color of the cells. Defaults to MaterialTheme.colorScheme.onSurface.

headerTextStyle

Typography of the header cells. Defaults to MaterialTheme.typography.labelLarge.

cellTextStyle

Typography of the body cells. Defaults to MaterialTheme.typography.bodyMedium.

rowSpacing

Vertical gap between body rows. Defaults to 0 dp.

cellPadding

Inner padding of every cell. Defaults to 12 x 10 dp.

shape

Corner shape of the table surface. Defaults to RoundedCornerShape with DefaultStylishDimensions.connectedCornerRadius.