poi 文字样式

// 文字样式
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;
}

猜你喜欢

转载自blog.csdn.net/shishize55/article/details/83892642
今日推荐