Expand description
A table widget for iced 0.14.
This crate provides a Table widget that displays rows of data in columns
with synchronized header, body, and optional footer scrolling. Columns can be
interactively resized by dragging dividers, rows can be clicked and visually
highlighted via single-row selection, header cells can be clicked to trigger
sorting, and the table’s appearance is fully customizable via the Catalog
trait.
§Getting started
- Define a column type that implements the
Columntrait. - Create
widget::Ids for the header, body, and (optionally) footer scrollables. - Call
table()to build the widget. - In your
updatefunction, handle theon_syncmessage by scrolling the header and footer scrollables to the received offset so they stay aligned with the body.
ⓘ
use iced::widget;
use iced_table2::table;
let header_id = widget::Id::unique();
let body_id = widget::Id::unique();
let table = table(header_id, body_id, &columns, &rows, Message::TableSynced)
.cell_padding(8)
.min_width(600.0);