phpexcel fill background color
snippet in php

phpexcel fill background color

user6279

$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
      )
    )
  )
);