Created
July 25, 2019 13:57
-
-
Save natergj/0ddb5c287cbba42c7cff614728c47337 to your computer and use it in GitHub Desktop.
excel4node background color and font
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xl = require("excel4node"); | |
const wb = new xl.Workbook(); | |
const ws = wb.addWorksheet("Background Color"); | |
const greenBgColumnsRows = wb.createStyle({ | |
font: { color: "black", size: 12 }, | |
fill: { | |
type: "pattern", | |
patternType: "solid", | |
bgColor: "#33FF35", | |
fgColor: "#33FF35" | |
} | |
}); | |
const textStyle = wb.createStyle({ | |
font: { color: "black", size: 16, bold: true } | |
}); | |
ws.cell(11, 4, 13, 13) | |
.string("default text") | |
.style(greenBgColumnsRows); | |
ws.cell(11, 7) | |
.string("10 Min-Mittelwerte") | |
.style(textStyle); | |
wb.write("BG_Color_Font.xlsx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment