[BUG] line-break in table header generates error in Excel for Mac
- Dominant language
- JavaScript
- Stars
- 15.5k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug Report
Using line break characters in the header of a table generates an error when trying to open the generated file on Mac.
Lib version: 4.2.1
## Steps To Reproduce
```javascript
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet(title, {
properties: {
defaultColWidth: 30,
},
pageSetup: {
paperSize: 9,
orientation: 'landscape',
},
});
worksheet.addTable({
name: 'table',
ref: 'A1',
headerRow: true,
style: {
theme: 'TableStyleLight2',
showRowStripes: true,
},
columns: [
{ name: 'Test\r\nmultiple\r\nlines' },
],
rows: [
['Test'],
],
});
worksheet.getCell('A1').alignment = { wrapText: true };
await workbook.xlsx.writeFile('test.xlsx');
```
## The expected behaviour:
After the file gets stored, we can open it and see its content.
## The actual behaviour:
An error pops up:


Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.