poi

 // 样式
  // 会计样式
  HSSFCellStyle moneyCellStyle = wb.createCellStyle();
  moneyCellStyle.setDataFormat((short) 39);

  HSSFCellStyle STYLE_CENTER = wb.createCellStyle();
  HSSFCellStyle STYLE_LEFT = wb.createCellStyle();
  HSSFCellStyle STYLE_RIGHT = wb.createCellStyle();

  STYLE_CENTER.setAlignment(HSSFCellStyle.ALIGN_CENTER);
  STYLE_LEFT.setAlignment(HSSFCellStyle.ALIGN_LEFT);
  STYLE_RIGHT.setAlignment(HSSFCellStyle.ALIGN_RIGHT);

  //自动换行
  STYLE_CENTER.setWrapText(true);
  STYLE_LEFT.setWrapText(true);
  STYLE_RIGHT.setWrapText(true);

你可能感兴趣的:(poi)