apache-poi - Apache POI excel如何为单元格应用文本左上缩进
问题描述
如何在 Apache POI 中添加左上缩进与左文本对齐?
我目前拥有的:
private CellStyle setDateAndTimeCellStyle(XSSFWorkbook workbook, Font font) {
CellStyle dateCellStyle = workbook.createCellStyle();
dateCellStyle.setWrapText(true);
dateCellStyle.setAlignment(CellStyle.ALIGN_LEFT);
dateCellStyle.setIndention(CellStyle.VERTICAL_TOP);
dateCellStyle.setFont(font);
dateCellStyle.setBorderTop(CellStyle.BORDER_THIN);
dateCellStyle.setBorderLeft(CellStyle.BORDER_THIN);
dateCellStyle.setBorderRight(CellStyle.BORDER_THIN);
return dateCellStyle;
}
CellStyle dateCellStyle = setDateAndTimeCellStyle(workbook, font);
解决方案
推荐阅读
- html - 我的背景图片不想出现!?
- ios - UIViewController 没有释放,内存泄漏 swift 4.0
- javascript - JavaScript ES6 - 父类中的静态方法返回子类中设置的值
- android - Android:压缩视频的最佳方法是什么
- scala - Scala 类型类模式与模式匹配或重载
- sql - 使用默认约束值更新字段
- apache-spark-sql - Spark SQL from_json 文档
- c# - 如何在 XtraInputBox 中仅接受数值以及如何检查单击了哪个按钮?
- webusb - Google Chrome WebUSB API requestDevices() 看不到条形码扫描仪 Voyager 1450g
- c++ - 结构异常的 C++ 清除向量