Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 反应mui数据表更改标题颜色_Reactjs_Mui Datatable - Fatal编程技术网

Reactjs 反应mui数据表更改标题颜色

Reactjs 反应mui数据表更改标题颜色,reactjs,mui-datatable,Reactjs,Mui Datatable,我试图更改mui datatables的头部,但它无法正常工作 import MUIDataTable from "mui-datatables"; import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles'; ... // here I set the them const getMuiTheme = () => createMuiTheme({ overrides:

我试图更改
mui datatables
的头部,但它无法正常工作

import MUIDataTable from "mui-datatables";
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
...

// here I set the them
const getMuiTheme = () => createMuiTheme({
    overrides: {
        MuiTableHead: {
            root: {
                backgroundColor: "#c1e1ec"
            }
        }
    }
});

...

// rendering
<MuiThemeProvider theme={getMuiTheme()}>                                                    
    <MUIDataTable
        title={"Existing Users"}
        data={users}
        columns={columns}
        options={options}
    />
</MuiThemeProvider>

每个子级
.muidatableHeadCell fixedHeader
都有自己的背景,因此您应该更改此类,然后
.MuiTableHeader root

或者以我认为更好的方式

MuiTableCell:{
负责人:{
背景颜色:“红色!重要”
}
}

每个子级
.muitatableHeadCell fixedHeader
都有自己的背景,因此您应该更改此类,然后
.muitatableHeader root

或者以我认为更好的方式

MuiTableCell:{
负责人:{
背景颜色:“红色!重要”
}
}
.MuiTableHead-root {
    display: table-header-group;
    background-color: #c1e1ec;
}