Skip to main content

DataTable2

Deprecated

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​

Deprecated

Deprecated since version 1.2.0 and scheduled for removal in 1.5.0. Use DataTable with scroll set instead.

A DataTable in scrolling mode.

DataTable2 sends a DataTable with scroll set, and maps its renamed properties:

The two legacy scroll bar flags override visibility on their respective axes.

Every other property has the same name on DataTable.

Inherits: DataTable

Properties

Properties​

bottom_marginclass-attributeinstance-attribute​

bottom_margin: Number | None = None

Space 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 = None

The 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.AUTO

How the table's scroll bars show.

visible_horizontal_scroll_barclass-attributeinstance-attribute​

visible_horizontal_scroll_bar: bool | None = None

Whether 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 = None

Whether the vertical scroll bar always shows.

DataTable.scroll controls the default for both axes.