I'm using handsontable and my grids are dynamics. I'm creating them by pushing the data from a XML file. So, the content of the columns are always differents and I want that the width of that columns are defined with the content of the existing cells. If the column contains just "Parley", I want a short width and if I have "One Ring to rule them all", the width should increase.
How should I do please ?
EDIT :
I tried to add : autoColumnSize : true
and it works at the beginning, but if I enter a value in a cell, every cells are shrinking.
Before :
After :
And this is the options I use to declare my hot :
var hot_itk = new Handsontable(container, {
data: data_itk,
minSpareRows: 1,
autoColumnSize : true,
observeChanges : true,
columnSorting : true,
rowHeaders: false,
colHeaders: false,
contextMenu: true,
height: 550,
Have you tried using the stretchH: all
option?
var hot_itk = new Handsontable(container, {
data: data_itk,
minSpareRows: 1,
autoColumnSize : true,
stretchH: 'all',
...
This stretches the table to the container's width.
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