What I want to do add top-border to above table.
I tried
const styles = theme => {
root : { borderTopWidth: 1, borderColor: 'red'}
}
...
class TableComponent ...
{ classes } = this.props;
<Table className={classes.root}>
</Table
export default withStyles(styles)(TableComponent)
I believe it's not a syntax problem, because other option like background: 'red' working properly.
Perhaps I missed something. How can I implement topBorder to this table?
To quickly add a border radius to all instances of a component, create a custom theme and add an overrides section. To create a custom theme, use the createMuiTheme hook. Then import that theme at a high level in your component and wrap all subcomponents in a ThemeProvider that uses that theme.
You should use the borderColor prop on it like this: <Box borderColor="primary. main">… <Box borderColor="secondary.
You forgot to define a borderStyle
property
const styles = theme => {
root : { borderTopWidth: 1, borderColor: 'red',borderStyle: 'solid'} // or borderTop: '1px solid red'
}
...
class TableComponent ...
{ classes } = this.props;
<Table className={classes.root}>
</Table
export default withStyles(styles)(TableComponent)
or you can just add inline style like
<Table style={{borderTop: '1px solid red'}}>
</Table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With