how to define tr, td, label styles in material table

Viewed 170

Hi I am now using material table in react.

here: https://material-table.com/#/docs/features/styling, we can use cellStyle, headerStyle, but what if I want to define more details, like styles of <tr> <td> of the cell, add <label> to the cell conent, how can we do that?

1 Answers

<tr> is table row, so you can use options.rowStyle.
<td>is table cell, so you can use column.cellStyle.

If you want specific styles to some cells, you can pass React or html elements to the data:

data={[
  { name: <div><h1>Baran</h1>aaa</div> },
  { name: <MyStyledCellWithMultipleElements name="Joe" /> }
]}
Related