// 文字样式
public CellStyle text(Workbook wb) {
CellStyle style = wb.createCellStyle();
Font font = wb.createFont();
font.setFontName("Times New Roman");
font.setFontHeightInPoints((short) 10);
style.setFont(font);
style.setAlignment(CellStyle.ALIGN_LEFT); // 横向居左
style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); // 纵向居中
style.setBorderTop(CellStyle.BORDER_THIN); // 上细线
style.setBorderBottom(CellStyle.BORDER_THIN); // 下细线
style.setBorderLeft(CellStyle.BORDER_THIN); // 左细线
style.setBorderRight(CellStyle.BORDER_THIN); // 右细线
return style;
}
poi 文字样式
最新推荐文章于 2025-04-11 17:02:00 发布