合并單元格邊框樣式消失
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);
我是個雙魚座的小王子,沉浸在自己的代碼世界里,去探索這未知的世界,希望遇到更多的小伙伴一起前行!

浙公網安備 33010602011771號