My aim is to set the first column's width equal to a certain number and leave other columns' widths untouched. Now I know that setting
colWidths: [myValue]
actually breaks other columns' widths but this seems to be workaroundable using
colWidths: function(index) {
if(index == 0)
return myValue;
return ???
}
but I wonder what should I return in the place of ???
? undefined
doesn't work (well, it works in the same fashion as colWidths: [myValue]
– every other column gets the same default width). How do I get the "width by content" value for this?
Use the option manualColumnResize instead of colWidths but the same way as in your question (only defining the first column witdh) :
manualColumnResize: [myValue]
The first column width will be define as your value, the other columns will still be dynamic. (Because of autoColumnSizeObject set to true by default, which is also changed to false when you use colWidths option).
You can find a working example here.
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