Sheetjs: Set cell style when creating new .xlsx

Created on 29 Mar 2017  路  7Comments  路  Source: SheetJS/sheetjs

Is it possible to set cell style? if, yes how? When trying to parse it clearly returns it:
A1: { t: 'n', v: 1, w: '1', s: { patternType: 'solid', fgColor: { rgb: 'FFFF00' }, bgColor: { indexed: 64 } } } }

But what about setting it?

Style

Most helpful comment

Writing styles is currently not supported, and we will be changing the style representation soon. Stay tuned.

All 7 comments

Writing styles is currently not supported, and we will be changing the style representation soon. Stay tuned.

The only question that remains : when ?? I'd love to do my part in this if you need !

@SheetJSDev Any ideas on when that would land? It would be really awesome to incorporate into my current project. We're looking into some pretty ugly workarounds right now and a supported solution would obviously be way better.

@Matas555 , @shoshannamb , i just make a fork, where try to implement styles and images from another forks to current version in main project (0.10.2)
https://github.com/xSirrioNx/js-xlsx

@SheetJSDev : is it possible to format XLSX document before export from the html

@xSirrioNx -- I tried your branch with the following configs, and it did not work. Any suggestions?

    let wb = XLSX.utils.table_to_book(tbl);
    wb.Sheets.Sheet1.A1.s = { fill: {patternType: "none",fgColor: {rgb: "FF000000"},bgColor: {rgb: "00000000"}} }
    let wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'binary' });

We offer this in the Pro compendium. Since companies have paid for the features already, it would be unfair to them if we turned around and made it available as open source. We have a longer comment in a gist.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sangpuion picture sangpuion  路  3Comments

thomasledoux1 picture thomasledoux1  路  3Comments

gustavosimil picture gustavosimil  路  3Comments

DannyRyman picture DannyRyman  路  3Comments

mmancosu picture mmancosu  路  3Comments