diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java index 7cf2472ca4..e140a1ec96 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java @@ -803,7 +803,10 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { for (CTTableColumn col : ctTableColumns.getTableColumnList()) { XSSFCell cell = row.getCell(cellnum); if (cell != null) { - col.setName(formatter.formatCellValue(cell)); + String colName = formatter.formatCellValue(cell); + colName = colName.replace("\n", "_x000a_"); + colName = colName.replace("\r", "_x000d_"); + col.setName(colName); } cellnum++; }