setColumnWidth(int, int) should work ... is it because you reset the sizes to auto in your loop?for (int i = 0; i < headers.length; i++) { sheet.autoSizeColumn(i);}从1到headers.length开始循环.Start your loop from 1 to headers.length instead. 这篇关于如何在Apache POI中设置固定的列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!