//四个参数分别是开始行,结束行,开始列,结束列
CellRangeAddress cellRange = new CellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol);
sheet.addMergedRegion(cellRange);
//添加边框
RegionUtil.setBorderTop(1, cellRange, sheet, workbook);
RegionUtil.setBorderBottom(1, cellRange, sheet, workbook);
RegionUtil.setBorderLeft(1, cellRange, sheet, workbook);
RegionUtil.setBorderRight(1, cellRange, sheet, workbook);
JAVA 导入EXCEL合并单元格无法显示边框问题
最新推荐文章于 2024-04-03 10:49:16 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)