website/docs/controls/datatable2/index.md
import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs'; import {ClassAll, CodeExample, Image} from '@site/src/components/crocodocs';
Enhanced data table for Flet that adds sticky headers, fixed rows/columns, and other UX improvements via the flet-datatable2 extension.
It wraps the Flutter data_table_2 package.
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|---|---|---|---|---|---|---|
| Supported | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Add flet-datatable2 to your project dependencies:
requirements.txt or pyproject.toml.
</TabItem>
<CodeExample path={frontMatter.examples + '/empty_state/main.py'} language="python" />
<Image src={frontMatter.example_images + '/empty_state.png'} width="55%" />
<CodeExample path={frontMatter.examples + '/sortable_and_selectable/main.py'} language="python" />
<Image src={frontMatter.example_media + '/sortable_and_selectable.gif'} width="65%" />
<CodeExample path={frontMatter.examples + '/column_widths/main.py'} language="python" />
<Image src={frontMatter.example_images + '/column_widths.png'} width="65%" />