-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styles not working #6
Comments
This works for me use
use both |
Same issue -- unable to use the styles:
|
I also can't seem to get even the simplest code to work....
This works but it doesn't format anything |
Same here. The workSheet object is being updated before the addition to the workbook, but no styles are applied. `let workSheet = XLSX.utils.aoa_to_sheet(sheetData);
|
Got the same problem. No styling applied what-so-ever. Instructions just advise to download the package and apply the styling. |
Any updates on this? Styles are still not working. |
Looks like this works only via import. Use webpack. |
replace: import * as XLSX from 'xlsx'; to : import * as XLSX from 'sheetjs-style'; |
Instead of messing with webpack, i would use xlsx-js-style that comes with the bundled option and some fixes. |
const XLSX = require('sheetjs-style');
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.json_to_sheet([{
0: 0,
1: 1,
2: 2
}], {
header: ['0', '1', '2'],
});
ws["A1"].s = { // set the style for target cell
font: {
name: '宋体',
sz: 24,
bold: true,
color: {
rgb: "FFFFAA00"
}
},
};
XLSX.utils.book_append_sheet(wb, ws, 'sheet1'); // add worksheet to workbook
XLSX.writeFile(wb, 'test.xlsx'); // write workbook |
This trick works fine! |
Guys, replace: const XLSX = require('sheetjs-style'); to const XLSX = require("xlsx-js-style"); !! |
Styles are not working it seems. Or maybe I'm not using this properly
I import and I'm using the project like this
I tried also with different fonts. I tried without the font block and just see if I could fillt the cell, but the A1 cell is showing unformatted
How we should use this? Seems like it is being totally ignored
Many thanks!
The text was updated successfully, but these errors were encountered: