How update table styling after sorting?
gabrielizalo opened this issue · 1 comments
gabrielizalo commented
I created a Zebra Table with sort columns:
The did setup the zebra style in this way:
<MaterialTable
data={data}
columns={columns}
...
options={{
...
rowStyle: (rowData) => ({
backgroundColor:
rowData.tableData.id % 2 === 0
? "var(--white)"
: "var(--wild-sand)",
}),
}}
/>
After sorting, the background colors remains in the original rows, so the table is not a zebra table anymore:
How I can update the "zebra styling" of the table after sorting?
Thanks
gabrielizalo commented
The solution was very easy as pointed here: material-table-core/core#781 (comment)