`
zhouchaofei2010
  • 浏览: 1088423 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

poi 设置列宽

 
阅读更多
 void autoSizeColumn(int column, boolean useMergedCells)
          Adjusts the column width to fit the contents.

 

 void autoSizeColumn(int column)
          Adjusts the column width to fit the contents.

 

 

 //列宽
		sheet.autoSizeColumn(0,true);//第一列是合并列
		for(int i=1;i<=1+years.size()*4;i++){
			sheet.autoSizeColumn(i);
		}
		

 

解释:对于合并列需要用 sheet.autoSizeColumn(0,true)方法,用  sheet.autoSizeColumn(0)无效

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics