Reputation: 167
Without stickyHeader I can change its color, but when I put stickyHeader the color becomes its default as white.
<Table aria-label="customized table" >
<TableHead stickyHeader style={{backgroundColor: "black" }}>
Upvotes: 2
Views: 5855
Reputation: 91
As shubham Baranwall said,specify the backgroundColor style at not but as follows,
<TableHead stickyHeader={true} >
<TableCell style={{backgroundColor: "black"}}> HeadColumn1 <TableCell>
<TableCell style={{backgroundColor: "black"}}> HeadColumn2 <TableCell>
<TableCell style={{backgroundColor: "black"}}> HeadColumn3 <TableCell>
</TableHead>
Upvotes: 1
Reputation: 15722
Make sure you actually have a row with at least one cell. Otherwise the TableHead
has nothing to render
// ...
<TableHead stickyHeader style={{ backgroundColor: 'blue' }}>
<TableRow>
<TableCell>Cell Content</TableCell>
// More cells...
</TableRow>
</TableHead>
// ...
Upvotes: 2