Apache poi 怎么加粗显示?

想对Excel中某些cell值加粗显示,使用的是最新的Apache poi jar包

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.17</version>
    </dependency>

使用了下面的方法不起作用

    XSSFCellStyle cellStyle = wb.createCellStyle();
    XSSFFont font = wb.createFont();
    font.setBold(true);
    cellStyle.setFont(font);
    cell.setCellStyle(cellStyle);

并且bold默认就为true

set a boolean value for the boldness to use. If omitted, the default value is true.

所以怎么才能加粗显示呢?

阅读 6.2k
1 个回答

最后发现原来只是Mac Numbers不支持而已

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进