pub struct Table { /* private fields */ }Expand description
A layout table: declare columns with Table::column, then add rows of
widgets with Table::row. Rows shorter than the column list leave the
remaining cells empty; extra cells beyond the column list are ignored.
Implementations§
Source§impl Table
impl Table
Sourcepub fn column(self, c: TableColumn) -> Self
pub fn column(self, c: TableColumn) -> Self
Append one column definition.
Sourcepub fn columns(self, cs: Vec<TableColumn>) -> Self
pub fn columns(self, cs: Vec<TableColumn>) -> Self
Append several column definitions.
Sourcepub fn row(self, cells: Vec<BoxedWidget>) -> Self
pub fn row(self, cells: Vec<BoxedWidget>) -> Self
Append a row of cell widgets (one per column, left to right).
Sourcepub fn row_builder(
self,
count: usize,
builder: impl Fn(usize) -> Vec<BoxedWidget>,
) -> Self
pub fn row_builder( self, count: usize, builder: impl Fn(usize) -> Vec<BoxedWidget>, ) -> Self
count rows, each built by calling builder(i) for its cell
widgets (one per column, left to right) — the same convenience
constructor Grid::builder/Carousel::builder/ListView::builder
have. Eager, not virtualized.
Sourcepub fn spacing(self, h: f32, v: f32) -> Self
pub fn spacing(self, h: f32, v: f32) -> Self
Horizontal gap between columns / vertical gap between rows.
Sourcepub fn cell_padding(self, p: f32) -> Self
pub fn cell_padding(self, p: f32) -> Self
Uniform padding inside every cell (logical px).
Sourcepub fn row_background(self, c: Color) -> Self
pub fn row_background(self, c: Color) -> Self
Zebra striping: fill every odd row (1, 3, 5, …) with c.
Sourcepub fn divider(self, width: f32) -> Self
pub fn divider(self, width: f32) -> Self
Draw a hairline of width px between rows (centered in the
vertical gap). Color defaults to the theme’s outline.
Sourcepub fn divider_color(self, c: Color) -> Self
pub fn divider_color(self, c: Color) -> Self
Override the divider hairline color.
Trait Implementations§
Source§impl Widget for Table
impl Widget for Table
Source§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
ctx.constraints and return a size within them. Read more