Setting width of spreadsheet cell using PHPExcel

后端 未结 7 961
萌比男神i
萌比男神i 2021-01-31 13:20

I\'m trying to set the width of a cell in an Excel document generated with PHPExcel with:

$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn(\'C\')         


        
相关标签:
7条回答
  • 2021-01-31 14:08

    hi i got the same problem.. add 0.71 to excel cell width value and give that value to the

    $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);
    

    eg: A Column width = 3.71 (excel value)

    give column width = 4.42

    will give the output file with same cell width.

    $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(4.42);
    

    hope this help

    0 讨论(0)
提交回复
热议问题