jspreadsheet / ce

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
https://bossanova.uk/jspreadsheet/v4
MIT License
6.7k stars 820 forks source link

For wide table, defaultColWidth not respected #229

Closed tejcirkulate closed 5 years ago

tejcirkulate commented 5 years ago

Hi Paul,

I am initing a table that consists of 20 cols and a set width of defaultColWidth:150 like this: (https://i.imgur.com/a0uyMEi.png)

but the 20 columns show up completely getting squeezed into the browser window like this:

(https://i.imgur.com/i00fG5X.png)

It appears that with defaultColWidth is not being respected. I would think that the right behaviour would be to show cols with 150 width and then have overflow columns be available through a scroll. Do I need to try something else to accomplish that?

tejcirkulate commented 5 years ago

Heres something else I learned. I've disabled the table-layout:fixed property and this makes the defaultColWidths work just fine.

See here. https://i.imgur.com/QfCrO2d.jpg

Is there any side effect of doing this?

tejcirkulate commented 5 years ago

In case theres no unintended consequences, adding the following right after initing jexcel works for me:

$(".jexcel").css("table-layout", "auto");