How to center the text in PHPExcel merged cell
if you want to align only this cells, you can do something like this: $style = array( ‘alignment’ => array( ‘horizontal’ => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, ) ); $sheet->getStyle(“A1:B1”)->applyFromArray($style); But, if you want to apply this style to all cells, try this: $style = array( ‘alignment’ => array( ‘horizontal’ => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, ) ); $sheet->getDefaultStyle()->applyFromArray($style);