DataTable Styling
There are props that we can explore to ensure the datatable is shaped correctly and reacts in the way we expect. We can set on_paste
to True
, which allows us to paste directly into a cell. We can use draw_focus_ring
to draw a ring around the cells when selected, this defaults to True
so can be turned off if we do not want it. The rows
prop can be used to hard code the number of rows that we show.
freeze_columns
is used to keep a certain number of the left hand columns frozen when scrolling horizontally. group_header_height
and header_height
define the height of the group header and the individual headers respectively. max_column_width
and min_column_width
define how large or small the columns are allowed to be with the manual column resizing. We can also define the row_height
to make the rows more nicely spaced.
We can add row_markers
, which appear on the furthest left side of the table. They can take values of 'none', 'number', 'checkbox', 'both', 'clickable-number'
. We can set smooth_scroll_x
and smooth_scroll_y
, which allows us to smoothly scroll along the columns and rows.
By default there is a vertical_border
between the columns, we can turn it off by setting this prop to False
. We can define how many columns a user can select at a time by setting the column_select
prop. It can take values of "none", "single", "multi"
.
We can allow overscroll_x
, which allows users to scroll past the limit of the actual horizontal content. There is an equivalent overscroll_y
.
Check out these docs for more information on these props.
Theming
Lastly there is a theme
prop that allows us to pass in all color and font information for the data table.