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 am having this issue the shading works everywhere properly but when I am opening the docx in word on my system. For some reason the color's of the shading are turning black. Please find below the code and POC.
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
// ✅ Header Row
new TableRow({
children: [
createStyledTableCell_legend("Severity Level", "FFFFFF", "0B3D91"), // Dark Blue Background
createStyledTableCell_legend("Severity Number", "FFFFFF", "0B3D91"), // Dark Gray Background
createStyledTableCell_legend("Explanation", "FFFFFF", "0B3D91"), // Dark Blue Background
],
}),
// ✅ Data Rows
...severityLevels.map(
(severity) =>
new TableRow({
children: [
createSeverityCell(severity.level), // Severity Level with background color
createTableCell_legend(severity.sev, AlignmentType.CENTER), // Severity Number
createTableCell_legend(severity.explanation), // Explanation
],
})
),
],
});
};
// ✅ Function to create header cells with background color
const createStyledTableCell_legend = (
text: string,
color: string,
bgColor: string
) => {
return new TableCell({
children: [
new Paragraph({
children: [new TextRun({ text, bold: true, color, font: "Helvetica" })],
alignment: AlignmentType.CENTER,
}),
],
shading: { type: ShadingType.SOLID, fill: bgColor },
});
};
The text was updated successfully, but these errors were encountered:
I am having this issue the shading works everywhere properly but when I am opening the docx in word on my system. For some reason the color's of the shading are turning black. Please find below the code and POC.
The text was updated successfully, but these errors were encountered: