poi excel设置合并单元格边框格式
版本3.17
//设置合并单元格的边框
public static void setBorderForMergeCell(BorderStyle style,int color, CellRangeAddress cra,Sheet sheet){
RegionUtil.setBorderTop(style,cra,sheet);
RegionUtil.setBorderBottom(style,cra,sheet);
RegionUtil.setBorderLeft(style,cra,sheet);
RegionUtil.setBorderRight(style,cra,sheet);
RegionUtil.setTopBorderColor(color,cra,sheet);
RegionUtil.setBottomBorderColor(color,cra,sheet);
RegionUtil.setLeftBorderColor(color,cra,sheet);
RegionUtil.setRightBorderColor(color,cra,sheet);
}
调用
mergeCell(rowId, rowId + rowSkip,
colIndex, colIndex + cellSkip,sheet); // 起始行, 终止行, 起始列, 终止列 // 终止行,
setBorderForMergeCell(BorderStyle.MEDIUM,(short)22,new CellRangeAddress(rowId, rowId + rowSkip,
colIndex, colIndex + cellSkip),sheet);
转载于:https://www.cnblogs.com/pu20065226/p/10120370.html
总结
以上是生活随笔为你收集整理的poi excel设置合并单元格边框格式的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: table 的表头
- 下一篇: JZOJ100047.基因变异 (St