XSSFCellStyle cs = workbook.createCellStyle(); // 换行的关键,自定义单元格内容换行规则 cs.setWrapText(true);//设置换行 //然后再使用XSSFCell的对象加载cs即可:cell.setCellStyle(cs);