7

Today I had a little problem with excelphp. I wanted to set the default width of the columns manually and only one single time.

I found a few solutions also here on stackoverflow which suggested to change the value for every single column (e.g. within a loop).

But I wanted to do it with a single command.

yacon
  • 1,112
  • 1
  • 10
  • 17

1 Answers1

25

After browsing the source code I found out the following solution:

$phpExcelObject->getActiveSheet()->getDefaultColumnDimension()
    ->setWidth($myCustomWidth);

I hope that this helps anybody else ;)

yacon
  • 1,112
  • 1
  • 10
  • 17