DataTable2
flet-datatable2 is deprecated since Flet 1.2.0 and will be removed in Flet 1.5.0.
DataTable2 is now DataTable with scroll set:
see Scrolling mode and the
migration guide.
DataTable2, DataColumn2 and DataRow2 still work: they send
Flet's own DataTable, DataColumn and
DataRow, with their renamed properties mapped.
Description
A DataTable in scrolling mode.
DataTable2 sends a DataTable with scroll
set, and maps its renamed properties:
data_row_heighttodata_row_min_heightanddata_row_max_height;min_widthtomin_content_width;bottom_margintobottom_padding.
The two legacy scroll bar flags override visibility on their respective axes.
Every other property has the same name on DataTable.
Inherits: DataTable
Properties
bottom_margin- Space after the last row.columns- The columns displayed in the table.data_row_height- The height of each data row.min_width- The width the columns keep when the table is narrower: below it, the table scrolls horizontally.scroll- How the table's scroll bars show.visible_horizontal_scroll_bar- Whether the horizontal scroll bar always shows.visible_vertical_scroll_bar- Whether the vertical scroll bar always shows.
Properties
bottom_marginclass-attributeinstance-attribute
bottom_margin: Number | None = NoneSpace after the last row.
Use DataTable.bottom_padding instead.
columnsclass-attributeinstance-attribute
columns: list[DataColumn] = field(default_factory=list)The columns displayed in the table.
data_row_heightclass-attributeinstance-attribute
data_row_height: Number | None = NoneThe height of each data row.
Use DataTable.data_row_min_height instead.
min_widthclass-attributeinstance-attribute
min_width: Number | None = field(
default=None, kw_only=True
)The width the columns keep when the table is narrower: below it, the table scrolls horizontally.
Use DataTable.min_content_width instead.
scrollclass-attributeinstance-attribute
scroll: ScrollMode | None = ScrollMode.AUTOHow the table's scroll bars show.
visible_horizontal_scroll_barclass-attributeinstance-attribute
visible_horizontal_scroll_bar: bool | None = NoneWhether the horizontal scroll bar always shows.
DataTable.scroll controls the default for both axes.
visible_vertical_scroll_barclass-attributeinstance-attribute
visible_vertical_scroll_bar: bool | None = NoneWhether the vertical scroll bar always shows.
DataTable.scroll controls the default for both axes.