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