public static void main(String[] args) throws Exception {
XSSFSheet sheet = workbook.createSheet("当前excel的名");
XSSFCellStyle style = workbook.createCellStyle(); // 样式对象
sheet.setDefaultRowHeight((short)400);//设置所有单元格高度
sheet.setDefaultColumnWidth((short)10);//设置所有单元格宽度
//发现许多悲伤的事,比如设置行的样式虽然有方法(setRowStyle)但是我发现没用,只能设置列的样式,
//许多方法都没用不知道是什么原因,要是有搞出来的告诉一声不胜感激。poi设置第一个东西都是下标从0开始
XSSFWorkbook workbook = new XSSFWorkbook();XSSFSheet sheet = workbook.createSheet("当前excel的名");
XSSFCellStyle style = workbook.createCellStyle(); // 样式对象
sheet.setDefaultRowHeight((short)400);//设置所有单元格高度
sheet.setDefaultColumnWidth((short)10);//设置所有单元格宽度