合并单元格边框样式消失
1、前置条件(合并前的单元格边框必须存在)
2、设置合并单元格样式
firstRow – Index of first row
lastRow – Index of last row (inclusive), must be equal to or larger than firstRow
firstCol – Index of first column
lastCol – Index of last column (inclusive), must be equal to or larger than firstCol
XSSFSheet sheet;
CellRangeAddress cellRangeAddress = new CellRangeAddress(firstRow , lastRow , firstCol , lastCol );
sheet.addMergedRegion(cellRangeAddress);
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRangeAddress, sheet);
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRangeAddress, sheet);
RegionUtil.setBorderRight(BorderStyle.THIN, cellRangeAddress, sheet);
RegionUtil.setBorderTop(BorderStyle.THIN, cellRangeAddress, sheet);
我是个双鱼座的小王子,沉浸在自己的代码世界里,去探索这未知的世界,希望遇到更多的小伙伴一起前行!