Auto column width in EPPlus

前端 未结 10 1400
心在旅途
心在旅途 2020-12-23 00:31

How to make columns to be auto width when texts in columns are long?

I use this code

 Worksheet.Column(colIndex).AutoFitColumn() \'on all columns\'
         


        
10条回答
  •  南笙
    南笙 (楼主)
    2020-12-23 00:58

    Just wanted to point out you can fit cells with out specifying the range, just make sure to call this after you've formatted all columns etc:

    worksheet.Cells.AutoFitColumns()
    

提交回复
热议问题