先导包:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0</version>
</dependency>
======================
遇到的坑:
cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);无法调出来。百度一下,可以用代替:
cellStyle.setAlignment(HorizontalAlignment.CENTER);
=========================================