日期:2014-05-18 浏览次数:21159 次
public static void setBorders(HSSFCellStyle style, short lc, short bc, short rc, short tc, short bl, short bb, short br, short bt) {
style.setBottomBorderColor(lc);
style.setLeftBorderColor(bc);
style.setRightBorderColor(rc);
style.setTopBorderColor(tc);
style.setBorderLeft(bl);
style.setBorderBottom(bb);
style.setBorderRight(br);
style.setBorderTop(bt);
}
cell.cell.setCellStyle(style);
HSSFCellStyle noBorder = book.createStyle();
style.setBorderLeft(HSSFCellStyle.BORDER_NONE);
style.setBorderBottom(HSSFCellStyle.BORDER_NONE);
style.setBorderRight(HSSFCellStyle.BORDER_NONE);
style.setBorderTop(HSSFCellStyle.BORDER_NONE);
cell.setCellStyle(noBorder);