mui-datatables
mui-datatables copied to clipboard
Set MUIDataTable theme header position to 'sticky'
I'm trying to set the position of my thead to be 'sticky' in MUIDataTable .
I have a getMuiTheme method:
export const getMuiTheme = () => createMuiTheme({
overrides: {
MuiTableCell: {
head: {
backgroundColor: "#c1e1ec !important",
position: 'sticky',
}
},
}
});
And I set this theme in my MuiThemeProvider:
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
title={renderTitle()}
data={showUnits()}
columns={columns}
options={options}
/>
</MuiThemeProvider>
The backgroundColor works, but my position do not work. If I manually change the thead position using the browser console, it works.