pub struct TableProps {Show 18 fields
pub header: Option<Row>,
pub rows: Vec<Row>,
pub widths: Vec<ColumnWidth>,
pub column_aligns: Vec<CellAlign>,
pub border_style: BorderStyle,
pub border_color: Option<Color>,
pub column_spacing: u16,
pub header_color: Option<Color>,
pub header_bg_color: Option<Color>,
pub header_bold: bool,
pub row_style: RowStyle,
pub stripe_color: Option<Color>,
pub selected: Option<usize>,
pub selected_color: Option<Color>,
pub selected_bg_color: Option<Color>,
pub row_dividers: bool,
pub width: Option<u16>,
pub bg_color: Option<Color>,
}Expand description
Properties for the Table component.
Fields§
§header: Option<Row>Optional header row.
rows: Vec<Row>Data rows.
widths: Vec<ColumnWidth>Column widths.
column_aligns: Vec<CellAlign>Default column alignment.
border_style: BorderStyleBorder style around the table.
border_color: Option<Color>Border color.
column_spacing: u16Spacing between columns.
header_color: Option<Color>Header text color.
header_bg_color: Option<Color>Header background color.
header_bold: boolWhether header is bold.
row_style: RowStyleRow styling (e.g., striped).
stripe_color: Option<Color>Color for odd rows (when striped).
selected: Option<usize>Currently selected row index (for highlighting).
selected_color: Option<Color>Selected row highlight color.
selected_bg_color: Option<Color>Selected row background color.
row_dividers: boolShow row dividers.
width: Option<u16>Total table width (optional, for percentage calculations).
bg_color: Option<Color>Background color for all cells (lowest priority).
Implementations§
Source§impl TableProps
impl TableProps
Sourcepub fn widths<I: IntoIterator<Item = ColumnWidth>>(self, widths: I) -> Self
pub fn widths<I: IntoIterator<Item = ColumnWidth>>(self, widths: I) -> Self
Set column widths.
Sourcepub fn fixed_widths<I: IntoIterator<Item = u16>>(self, widths: I) -> Self
pub fn fixed_widths<I: IntoIterator<Item = u16>>(self, widths: I) -> Self
Set all columns to fixed width.
Sourcepub fn column_aligns<I: IntoIterator<Item = CellAlign>>(self, aligns: I) -> Self
pub fn column_aligns<I: IntoIterator<Item = CellAlign>>(self, aligns: I) -> Self
Set column alignments.
Sourcepub fn border(self, style: BorderStyle) -> Self
pub fn border(self, style: BorderStyle) -> Self
Set border style.
Sourcepub fn border_color(self, color: Color) -> Self
pub fn border_color(self, color: Color) -> Self
Set border color.
Sourcepub fn column_spacing(self, spacing: u16) -> Self
pub fn column_spacing(self, spacing: u16) -> Self
Set column spacing.
Sourcepub fn header_color(self, color: Color) -> Self
pub fn header_color(self, color: Color) -> Self
Set header color.
Sourcepub fn header_bg_color(self, color: Color) -> Self
pub fn header_bg_color(self, color: Color) -> Self
Set header background color.
Sourcepub fn header_bold(self, bold: bool) -> Self
pub fn header_bold(self, bold: bool) -> Self
Set whether header is bold.
Sourcepub fn stripe_color(self, color: Color) -> Self
pub fn stripe_color(self, color: Color) -> Self
Set stripe color.
Sourcepub fn selected_style(
self,
color: Option<Color>,
bg_color: Option<Color>,
) -> Self
pub fn selected_style( self, color: Option<Color>, bg_color: Option<Color>, ) -> Self
Set selected row colors.
Sourcepub fn row_dividers(self) -> Self
pub fn row_dividers(self) -> Self
Enable row dividers.
Trait Implementations§
Source§impl Clone for TableProps
impl Clone for TableProps
Source§fn clone(&self) -> TableProps
fn clone(&self) -> TableProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more