PHPExcel
PHPExcel copied to clipboard
AUTOSIZE_METHOD_EXACT does not resize column as 'exact' as possible
I am using PHPExcel 1.8.0 due to issue with 1.8.1 (Valid Directory to TrueType Font files not specified https://github.com/PHPOffice/PHPExcel/issues/556 )
Here is my code
#here is code to put data $objPHPExcel object
\PHPExcel_Shared_Font::setAutoSizeMethod(\PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT);
foreach(range('A', 'K') as $columnID)
{
$objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);
}
# here is code to output in Excel2007 format (xlsx)
And this is the screenshot of excel
Column 'A', 'B' and 'C' have too much extra white spaces. There are no differences in setting PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT or not.
I expect the excel looks like below
Do I miss anything ?
Hi! Same problem here. My columns have too much extra white spaces. There are no differences in setting PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT or not. What was the soloution? Please give me an advice...