from reactable import Reactable, Column, embed_css
from reactable.data import cars_93
embed_css()
Rownames
Row names are shown by default if present. You can customize the row names column by adding a column definition using ".rownames"
as the column name:
TODO: support pandas index.
If row names haven’t been set explicitly, you can force them to show by setting rownames=True
:
Reactable(5, :],
cars_93[:=True,
rownames )
Row headers
Row headers help users navigate the table using assistive techonologies. When cells are marked up as row headers, assistive technologies will read them aloud while navigating through cells in the table.
You can mark up cells in a column as row headers by setting row_header
to True
in Column()
.
Cells in the row names column are automatically marked up as row headers.
= cars_93[:5, ["manufacturer", "model", "type", "price", "mpg_city", "air_bags"]]
data
Reactable(
data,=[
columnsid="manufacturer", row_header=True, style={"font-weight": "600"}),
Column(
],=True,
bordered )