PHPECXCLE设置样式

设置背景颜色

$objPHPExcel->getActiveSheet()->getStyle( 'A2:T2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
        $objPHPExcel->getActiveSheet()->getStyle( 'A2:T2')->getFill()->getStartColor()->setRGB('9bc2e6');
设置居中加粗

$objPHPExcel->getActiveSheet()->getStyle('A1:T1')->applyFromArray(
            array(
                'font' => array (
                    'bold' => true
                ),
                'alignment' => array(
                    'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER
                )
            )

        );

随机浏览