设置居中
$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);
设置默认行高
$objPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(30);
设置单元格宽度自适应
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);
设置文字类型
$objPHPExcel->getActiveSheet()->setCellValueExplicit( $cellRealName, $_value, \PHPExcel_Cell_DataType::TYPE_STRING2);
冻结窗格
$objPHPExcel->getActiveSheet()->freezePane('A2');