You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a similar problem, but my cells used to stay black. I was looking for a reason and found this issue. Then i realized i missed to add fgColor to my style. I also see the problem in your case. It yould be patternType: 'solid' not just pattern. You might have solved this old issue i just wanted to note for any other that might stumble over it!
Describe the bug
Set cell backgrounds by createStyle not working
To Reproduce
Run next code
`var style = workbook.createStyle({
font: {
color: '#FF0800',
size: 12
},
numberFormat: '$#,##0.00; ($#,##0.00); -'
});
var style2 = workbook.createStyle({
fill: {
type: 'pattern',
pattern: 'solid',
fgColor: '#f20202', // Foreground color
bgColor: '#f20202', // Background color
},
font: {
color: '#10c8c8',
size: 10,
}
});
worksheet2.cell(1,1).string("#").style(style2);
worksheet2.cell(1,2).string("Full Legal Name").style(style);
worksheet2.cell(1,3).string("Job Title").style(style2);
worksheet2.cell(1,4).string("Market").style(style2);
worksheet2.cell(1,5).string("Location Type").style(style2);
worksheet2.cell(1,6).string("Termination Date").style(style2);
workbook.write('Excel.xlsx');`
This will not apply red colors to the cell at style2, it keeps it white.
Expected behavior
Color should be applied to cell
Environment (please complete the following information):
Additional context
There are no environment errors
The text was updated successfully, but these errors were encountered: