0

I have a MaterialTable in a React application and I need to align center the text on columns, fix the font size for the text on the columns. Also need to fix the width for the Actions column because the space between the actions column and the first data column seems more than desirable.

I have tried:

cellStyle: {text-align:'center', font-size='8'},
headerStyle: {text-align:'center', font-size='8'}

I need to align center the text on columns, set the font size of text and fix the width for the actions column on a React Material Table

Ru Chern Chong
  • 3,692
  • 13
  • 33
  • 43
Juan Cortés
  • 11
  • 1
  • 1

2 Answers2

1

Try this:

display: flex;
justify-content:center;
flex-direction: column;
Cato Minor
  • 2,992
  • 3
  • 29
  • 42
Maark
  • 11
  • 3
1

When you are using JSX you need to change your css properties and remove the - and add the capital for the next word for example:

cellStyle: {text-align:'center', font-size='8'}
headerStyle: {text-align:'center', font-size='8'}

should become

cellStyle: {textAlign:'center', fontSize='8'}
headerStyle: {textAlign:'center', fontSize='8'}