PHPExcel how to apply text alignment horizontal fill - PHPExcel_Style_Alignment::HORIZONTAL_Fill

php, phpexcel

Solution

I think the constant you're looking for is

PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY

all the constants that are available for PHPExcel_Style_Alignment can be found defined at the top of the PHPExcel/Style/Alignment.php file

Problem

I'm using PHPExcel to create an excel doc... trying to set the cells text alignment horizontal to fill ``` $this->objPHPExcel->getDefaultStyle() ->getAlignment() ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_Fill); ``` tried to add to Alignment.php the option but that didn't work ``` const HORIZONTAL_Fill = 'fill'; ``` thanks!

Original source