I am setting column width for a .csv file using
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(50);
But i cannot see any change in column A's width, what am i doing wrong?
First, disable autosize:
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(false);
Now, you can set:
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth("50");
Assuming you're using the CSV Writer.
CSV files do not support any formatting, just data, so column width (which is formatting) cannot be applied when you write a CSV file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With