Row Properties
Style rows with Dash-safe selector rules for colors, classes, inline styles, and attributes.
Row Properties
Style rows with Dash-safe selector rules for colors, classes, inline styles, and attributes.
Source: usage.py::build_row_properties_code().
table = (
dmdt.DataTable(
id="row-properties-table",
data=EMPLOYEES[:6],
columns=ROW_PROPERTIES_COLUMNS,
paginationMode="none",
)
.update_layout(radius="lg", withTableBorder=True, striped=True)
.update_rows(
selector={"status": "Needs Review"},
color="orange.9",
backgroundColor={"light": "#fff4e6", "dark": "#4a2a12"},
className="dmdt-row-review",
)
.update_rows(
selector={"team": "Platform"},
style={"borderInlineStart": "4px solid var(--mantine-color-blue-5)"},
)
.update_rows(
selector={"deliveryScore": {"gte": 90}},
style={"fontWeight": 700},
)
.update_rows(
selector={"status": "Needs Review"},
attributes={"title": "This row needs review", "data-status": "needs-review"},
)
)