如何更改材料UI粘性标题表中的颜色?

时间:2020-07-22 07:43:04

标签: reactjs material-ui

没有 stickyHeader 的情况下,我可以更改其颜色,但是当我放置 stickyHeader 时,颜色将变为默认的白色。

<Table aria-label="customized table" >
<TableHead stickyHeader style={{backgroundColor: "black"  }}>

1 个答案:

答案 0 :(得分:2)

确保您实际上有至少一个单元格的行。否则,TableHead将无法呈现

// ...
<TableHead stickyHeader style={{ backgroundColor: 'blue' }}>
  <TableRow>
    <TableCell>Cell Content</TableCell>
    // More cells...
  </TableRow>
</TableHead>
// ...
相关问题