Expect column width in Percentage in handson table

Tags: #<Tag:0x00007f8b2b1f9178> #<Tag:0x00007f8b2b1f8fc0>

I am try to set column width in percentage but I couldn’t. Please give me a solution. We are using our application in difference resolution. I try to give width in pixel it will not be user friendly and will tick with pixel in big screen looking very hard. I am expecting it should increase the width of the column based on screen resolution so we need to set width in percentage but Handson table taking only pixel.is there any way?

Hi @saravanan.m

The width (table width) can be set in percentage values (ref https://handsontable.com/docs/javascript-data-grid/grid-size/) but colWidths does not accept a percentage value. However, if you use it as a function, you can calculate the percentage.

Here https://jsfiddle.net/0cq45rt6/ is an example on how to set the first column to 50% of the table size.

If you’d like to make table more dynamic (change width/column widths) when user changes the size of the window I also recommend checking stretchH option - https://handsontable.com/docs/javascript-data-grid/column-width/#column-stretching