How to use xlsx to set the style of the exported table in Node.js?

I have seen a lot of examples, all of which are used to set

in the following way.
cell.s = {
       font: { color: { rgb: "ffff00" } },
       fill: { bgColor: { rgb: "ffff00" } }
}

I tried and found that it didn"t work, but the style worked when I replaced the xlsx package with xlsx-style (all the previously exported data has been written the same).

I want to know why it doesn"t work with the xlsx package, is it that the package itself doesn"t support it, or is it that there"s something wrong with my writing? Hope God"s advice!

Jun.07,2021

I have looked at the source code of xlsx and xlsx-style libraries these days and found that xlsx does not seem to have a parsing style module, so it is invalid when you use attributes like s.font.color. On the other hand, xlsx-style, adds the module of style parsing.

clipboard.png

if you read an extra styleBuild, xlsx-style will be able to parse the style.

but after using xlsx-style, your row height must not be set. I have messed up a solution by myself, which you can refer to.

use xlsx-style to set the width and height style of the table:
https://www.jianshu.com/p/877.


how to play automatic line wrapping? I did not find the js-xlsx-related


xlsx-style style cannot set line height. I opened a branch and directly fixed it. Ok
you can directly use: npm install just2lab-xlsx-style-- save
source address: https://github.com/justinbett.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35e7e-2bfc5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35e7e-2bfc5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?