I am trying to set a fixed column/cell width to my exported excel files with js-xlsx.
EDIT:
Here is the source of js-xlsx: https://github.com/SheetJS/js-xlsx
Nothing new, but explicitly using the width
property makes it a bit easier to maintain:
ws['!cols'] = [{ width: 20 }, { width: 20 }, { width: 150 } ]; //set col. widths
Here is the full list of properties you can give to these ColInfo
objects though, they give reasons why each width exists, but they state you should use width
> wpx
> wch
, depending on the type of sheet you have and what is available for your use case. More can be read here: https://docs.sheetjs.com/