Handsontable increase row header width

2019-07-12 19:24发布

问题:

I'm using custom row header names and there is one that happens to be a little longer than others.

rowHeaders: ["Entree", "", "Plat", "", "Dessert", "", "Prix 2", "Prix 3"]

My question is how do I increase the row header width?

I have thoroughly checked the documentation without luck.

I've tried using colWidths: 200 in the options but that only works on everything except row header width.

Options documentation here.

回答1:

Please take a look at this fiddle

You can play with the css of columns to set the width:

.handsontable col.rowHeader {
    width: 180px;
}

And here is a working example of your case. If you remove css, you will get exact problem you are facing with. And if you re-add that css line, you will see it works.

Cheers.



回答2:

When creating the table in JS you can add the parameter

new Handsontable(container, {
    // ...
    rowHeaderWidth: 180,
    // ...
})