I've been attempting to adjust the padding of the Material UI Table
. The last-child
element is receiving a 24px padding which I'm trying to modify. Despite my attempts at overriding the theme and using classes{{root: classes.xxx}}
, I haven't been successful in making the change.
Here is the code snippet I used to override the theme (I also tried overriding MuiTableRow
and MuiTableColumn
):
const theme = createMuiTheme({
overrides: {
MuiTableCell: {
root: {
paddingTop: 4,
paddingBottom: 4,
'& $lastChild': { paddingRight: '5px' },
},
paddingDefault: {
padding: '40px 12px 40px 16px',
},
},
},
});
This is the CSS rule I'm looking to modify (applies to the last cell of each row in the table):
.MuiTableCell-root-511:last-child {
padding-right: 24px;
}
Any assistance would be greatly appreciated.