没有 stickyHeader 的情况下,我可以更改其颜色,但是当我放置 stickyHeader 时,颜色将变为默认的白色。
<Table aria-label="customized table" >
<TableHead stickyHeader style={{backgroundColor: "black" }}>
答案 0 :(得分:2)
确保您实际上有至少一个单元格的行。否则,TableHead
将无法呈现
// ...
<TableHead stickyHeader style={{ backgroundColor: 'blue' }}>
<TableRow>
<TableCell>Cell Content</TableCell>
// More cells...
</TableRow>
</TableHead>
// ...