【发布时间】:2023-02-17 20:09:19
【问题描述】:
我正在尝试将我的 thead 的位置设置为“粘性”在 MUIDataTable 中。
我有一个 getMuiTheme 方法:
export const getMuiTheme = () => createMuiTheme({
overrides: {
MuiTableCell: {
head: {
backgroundColor: "#c1e1ec !important",
position: 'sticky',
}
},
}
});
我在我的MuiThemeProvider 中设置了这个主题:
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
title={renderTitle()}
data={showUnits()}
columns={columns}
options={options}
/>
</MuiThemeProvider>
backgroundColor 有效,但我的职位无效。如果我使用浏览器控制台手动更改 thead 位置,它就可以工作。
【问题讨论】:
标签: reactjs mui-datatable