Fusuma

Components / Components

table

A table with headers for the columns and rows of cells (a row with fewer cells than headers leaves the rest empty; a longer one is cut).

Try it

This is the Data page of the gallery, running in your browser: table is on it, and it is the real widget. Press Run, then use it.

Live: Data, where table is usedOpen full size

Also on this pagespinnerkbdratingcarouseltimelineline_chartarea_chartbar_chart

A table with headers for the columns and rows of cells (a row with fewer cells than headers leaves the rest empty; a longer one is cut). The shape (the number of columns and rows) stays the same for as long as the table is shown.

The table is read-only and sized to its cells: for rows that are chosen, edited or too many for the screen use a list or virtual_rows.

Signature

pub const fn table<'a>(headers: &'a [&'a str], rows: &'a [&'a [&'a str]]) -> Table<'a>

Example

use fusuma::table;
let view = table(&["Item", "Qty"], &[&["Bolt", "10"], &["Nut", "25"]]);
let built = fusuma::doc::built::<(), _>(&view);
assert!(built.texts().contains(&"Bolt"));

All components · Source