POI操作Excel:cell的网线类型

POI中的对某个cell单元格设置网线的写法:

   HSSFCellStyle style = workbook.createCellStyle();

   style.setFillPattern(HSSFCellStyle.BIG_SPOTS);

   cell.setCellStyle(style);



具体参考API:http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/CellStyle.html

网线类型   执行结果
HSSFCellStyle.NO_FILL  
HSSFCellStyle.SOLID_FOREGROUND
HSSFCellStyle.FINE_DOTS
HSSFCellStyle.ALT_BARS
HSSFCellStyle.SPARSE_DOTS
HSSFCellStyle.THICK_HORZ_BANDS
HSSFCellStyle.THICK_VERT_BANDS
HSSFCellStyle.THICK_BACKWARD_DIAG
HSSFCellStyle.THICK_FORWARD_DIAG
HSSFCellStyle.BIG_SPOTS
HSSFCellStyle.BRICKS
HSSFCellStyle.THIN_HORZ_BANDS
HSSFCellStyle.THIN_VERT_BANDS
HSSFCellStyle.THIN_BACKWARD_DIAG
HSSFCellStyle.THIN_FORWARD_DIAG
HSSFCellStyle.SQUARES
HSSFCellStyle.DIAMONDS
 

你可能感兴趣的:(api,Excel)