pub struct Table { /* private fields */ }Expand description
A data table widget with column headers, row selection, and keyboard navigation.
Rows are provided as Vec<Vec<String>> — each inner Vec must match the
number of columns. Use Table::columns and Table::rows for
builder-style construction.
The table handles Up/Down keys internally for row selection. It is not
focusable in the Tab chain — keyboard events reach it through a parent
container’s forwarding.
Implementations§
Source§impl Table
impl Table
Sourcepub fn columns(self, columns: Vec<TableColumn>) -> Self
pub fn columns(self, columns: Vec<TableColumn>) -> Self
Sets the column definitions.
Sourcepub fn header_style(self, style: Style) -> Self
pub fn header_style(self, style: Style) -> Self
Sets the header row style.
Sourcepub fn select_style(self, style: Style) -> Self
pub fn select_style(self, style: Style) -> Self
Sets the selected row style.
Sourcepub fn set_selected(&mut self, index: Option<usize>, cx: &mut EventCx<'_>)
pub fn set_selected(&mut self, index: Option<usize>, cx: &mut EventCx<'_>)
Sets the selected row programmatically.
Sourcepub fn sort_by_column(&mut self, col: usize, cx: &mut EventCx<'_>)
pub fn sort_by_column(&mut self, col: usize, cx: &mut EventCx<'_>)
Sorts rows by the given column index, in ascending order. Invalid column index is a no-op.
Sourcepub fn set_column_width(&mut self, col: usize, width: u16, cx: &mut EventCx<'_>)
pub fn set_column_width(&mut self, col: usize, width: u16, cx: &mut EventCx<'_>)
Sets the width of a specific column. Minimum width is 3. Invalid column index is a no-op.
Sourcepub fn adjust_column_width(
&mut self,
col: usize,
delta: i16,
cx: &mut EventCx<'_>,
)
pub fn adjust_column_width( &mut self, col: usize, delta: i16, cx: &mut EventCx<'_>, )
Adjusts the width of a column by delta (positive = wider).
Invalid column index is a no-op.