Related issue
Wanted mui table with sticky header & rotated to -45 degree angle
Below din't work:
Wasted 3 hours to make stickyHeader work
<Table stickyHeader ...
Below worked:
- Apply
head1 CSS for TableHead:
- Apply
rotatedContent1 CSS for TableCell's child (NOTE: child):
Full code is something like below:
const TableStyles = theme => ({
head1: {
zIndex: 3,
position: 'sticky',
top: '0px',
},
rotatedContent1: {
transform: 'rotate(270deg)',
}
})
const Component1 = ({ classes }) => {
return (
<React.Fragment>
<Table>
<TableHead className={classes.head1}>
<TableCell>
<div className={classes.rotatedContent1}> header value </div>
</TableCell>
</TableHead>
<TableBody>
<TableRow>
<TableCell> value </TableCell>
</TableRow>
</TableBody>
</Table>
</React.Fragment>
)
}
export default withStyles(TableStyles)(Component1)