设置居中
$objPHPExcel->getActiveSheet()->getStyle($cellRealName)->applyFromArray( array( ‘alignment‘ => array( ‘horizontal‘ => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER ) ) );
设置单元内换行
$objPHPExcel->setActiveSheetIndex(0)->setCellValue(‘A4‘, “Hello\nWorld”); $objPHPExcel->getActiveSheet()->getStyle(‘A4‘)->getAlignment()->setWrapText(true);