iced_table2
A feature-rich table widget for iced 0.14.
Features
- Synchronized scrolling -- Header, body, and optional footer stay horizontally aligned as the user scrolls.
- Interactive column resizing -- Drag column dividers to resize. Visual feedback highlights the divider on hover.
- Customizable styling -- Implement the
Catalogtrait to control header, footer, row, and divider appearance. A default theme with alternating row colors is provided out of the box.
Usage
Add the dependency to your Cargo.toml:
[]
= "0.14"
Quick start
- Define a column type that implements
iced_table2::table::Column. - Create
widget::Ids for the header, body, and (optionally) footer scrollables. - Call
iced_table2::table()to build the widget. - Handle the
on_syncmessage in yourupdatefunction by callingscrollable::scroll_toon the header and footer ids to keep them in sync with the body.
use widget;
use table;
// In your view function:
let header_id = unique;
let body_id = unique;
let table = table
.cell_padding
.min_width;
To enable column resizing, chain .on_column_resize(Message::ColumnDragged, Message::ColumnReleased) and store the resize offsets in your column type.
License
GPL-3.0