POI导出Excel设置自适应列宽

sheet.autoSizeColumn(i); (版本不能太老)
sheet.autoSizeColumn(i, true);(合并的单元格使用)
sheet.setColumnWidth(i, “列名”.getBytes().length*2*256);(中文适用)

猜你喜欢

转载自blog.csdn.net/weixin_38204723/article/details/78921353