material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Any way to customize columns ?

Open kaleshasheik opened this issue 7 years ago • 5 comments

Hi,

Is there any way to customize the columns by adding something like columnstyle ?

Actually, I wanna reduce space between columns . so that, i can place the 2 tables side by side without scrolling.

Thanks, Kalesha sheik

kaleshasheik avatar Jan 25 '19 14:01 kaleshasheik

Not sure if its exactly what you are looking for but when creating the columns you can add custom css using headerStyle

IllusiveBagel avatar Jan 25 '19 14:01 IllusiveBagel

Not sure if its exactly what you are looking for but when creating the columns you can add custom css using headerStyle

I tried with below

{ title: 'Name', field: 'name', headerStyle: {color: 'white', fontSize: 15,width: '1%'}

},
{
  title: 'Status',
  field: 'status',
  headerStyle: {color: 'white', fontSize: 15, width: '1%'}
  
},

But, still width is not considering for columns

kaleshasheik avatar Jan 25 '19 14:01 kaleshasheik

Ok yeah I just tried a similar setup and everything apart from the width is changing for me too

IllusiveBagel avatar Jan 25 '19 14:01 IllusiveBagel

You're looking for the "cellStyle" property of "columns" if you're looking to work with column width.

martindeanlund avatar Jan 28 '19 18:01 martindeanlund

You're looking for the "cellStyle" property of "columns" if you're looking to work with column width.

Hi, i've tried to use "cellStyle" for resizing one of the columns but it didn't work for me. Here's how i did it.

{
            title: "Client",
            field: "client.company",
            cellStyle: { width: "20px" },
}

hamdi-islam avatar Feb 17 '19 19:02 hamdi-islam