pub fn text_table(cells: Vec<TextTableCell>) -> TextTableBuilderExpand description
§text_table
Compare text with content-sized columns and accessible merged cells.
§Usage
Compare specifications or settings with row and column headers.
§Parameters
cells— text, zero-based grid coordinates, spans and heading rolescolumns— column count; omitted values infer it from the cellsmodifier— table sizing and node behaviorstyle,header_style— data and heading typographycell_padding— content insets, defaulting to 24dp horizontally and 16dp verticallycolor,header_color— body and heading text colors; headings use the body color when no heading color is suppliedheader_background,divider_color— heading fill and row-rule colors
Columns adapt to measured text. Narrow columns use the text component’s wrapping behavior. Physical-pixel rounding preserves the total allocated width without gaps. Cells are read in row and column order. Grids cannot exceed 1,048,576 positions.
§Examples
use tessera_components::text_table::{TextTableCell, TextTableHeading, text_table};
#[tessera_ui::tessera]
fn comparison() {
let heading = TextTableCell {
text: "Size".into(),
heading: TextTableHeading::Column,
..Default::default()
};
let value = TextTableCell {
text: "Medium".into(),
row: 1,
..Default::default()
};
text_table(vec![heading, value]).columns(1);
}