Skip to main content

table

Function table 

Source
pub fn table<'a>(
    ui: &mut Ui,
    columns: &'a [Column<'a>],
    rows: usize,
    sizing: &Sizing<'_>,
    palette: &Palette,
    style: &TableStyle,
    draw: impl FnMut(&mut Ui, &'a Column<'a>, usize),
) -> Option<&'a Column<'a>>
Expand description

A described table, narrowed for the width available.

rows is a count and draw is called once per cell of each kept column, in column order. Taking a closure rather than a slice of contents is what keeps the app’s own data borrowed one cell at a time, which is group’s reasoning and immediate mode’s habit.

Returns the sortable column whose heading was pressed this frame, if any. The app owns the ordering, so this reports the press and changes nothing: what a press calls is an address, and the description names none. That is Column::sortable’s own documented split.

A heading is only pressable when its column says sortable. A column sorted by a key the user cannot change still draws its caret and does not answer.