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

PHPphpexcel

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!

Best Answer

Valid Alignment Styles

Horizontal alignment styles Can you use : HORIZONTAL_LEFT = 'left', HORIZONTAL_RIGHT = 'right', HORIZONTAL_CENTER = 'center', HORIZONTAL_CENTER_CONTINUOUS = 'centerContinuous' and HORIZONTAL_JUSTIFY = 'justify'.

Vertical alignment styles Can you use : VERTICAL_BOTTOM = 'bottom', VERTICAL_TOP = 'top', VERTICAL_CENTER = 'center', VERTICAL_JUSTIFY = 'justify' and HORIZONTAL_GENERAL = 'general'.

Related Topic