c#设置导出Excel的列宽

创建sheet页:sheet1

            sheet1.SetColumnWidth(0, 20 * 256);
            sheet1.SetColumnWidth(1, 30 * 256);
            sheet1.SetColumnWidth(2, 20 * 256);
            sheet1.SetColumnWidth(3, 15 * 256);
            sheet1.SetColumnWidth(4, 15 * 256);

0,1,2,3,4 代表列的位置;

20,30,20,15,15 代表列宽;

256 代表sheet页的总宽度

你可能感兴趣的:(NPOI设置Excel列宽,c#设置Excel列宽,NPOI,C#)