[GH #1017] Set Width for fixed columns

Tags: #<Tag:0x00007efc71a87ef0> #<Tag:0x00007efc71a87d88>

if I have many fixed columns, it takes the whole screen width especially if I display my table on a mobile screen.
how I can set a maximum width for fixed columns?
I know colWidth takes a function that returns width for a column,
how I can check if the column is fixed or not?

Hi @elnaggaralex

there are only two ways of handling width for columns

  • fixed (colWidths setup)
  • fluid (no min and no max)

We do not support min/max values yet.

@aleksandra_budnik
Ok,
How I know if column is fixed or not if i have column index ?
if I knew if column is fixed I can use colWidth function to set its width as I want it,
but how about other not-fixed column, how I can let their width to fit their contents ?
Thanks for your help :slight_smile:

Sorry, I might have used inconsistent naming.
Once you set up colWidths https://jsfiddle.net/wr42ofh6/ for all the columns https://jsfiddle.net/wr42ofh6/1/ or just one you can go back and make them expand automatically.

set colWidth as array may fix my issue but the problem is that it assign default width for remaining columns not making its width to fit the content.

Yes, that’s true.

I guess that you can leave auto width for all the columns and use a custom renderer to cut some columns to desired width. Example https://jsfiddle.net/b7L0pcvd/