Created
September 13, 2021 07:37
-
-
Save andreconghau/1ea41050fc8019c60f9e0065470865df to your computer and use it in GitHub Desktop.
phpexcel format cell fill background color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$page = 0; | |
$this->PhpExcel->createSheet($page); | |
$this->PhpExcel->setActiveSheetIndex($page); | |
$sheet = $this->PhpExcel->getActiveSheet(); | |
$sheet->getStyle("A1:A7")->applyFromArray( | |
array( | |
'fill' => array( | |
'type' => PHPExcel_Style_Fill::FILL_SOLID, | |
'color' => array('rgb' => 'FFE699') | |
), | |
'borders' => array ( | |
'allborders' => array ( | |
'style' => PHPExcel_Style_Border::BORDER_THIN, | |
'color' => array('rgb' => '000000'), // BLACK | |
) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment