MattJ MattJ -4 years ago 243
Javascript Question

set individual cell Styles js-xlsx, xlsx-style node.js

Can't find a way to style individual cells when writing to file. Reading is no problem though. Have tried either js-xlsx, xlsx-style, non seem to work? Or am I reading the API wrong?
If i read correctly it should be enough to set cell.s to an object like this

{ alignment: { horizontal: 'center', vertical: 'center' }, patternType: 'solid', bgColor: { indexed: 64 }, fgColor: { rgb: 'FFC6EFCE' } }

Answer Source

It seems it was not possible to style individual cells with js-xlsx. So I used a separate package for creating excel files exceljs

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download