PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

Font Style existed but not visible #1415

Open responsetech opened 5 years ago

responsetech commented 5 years ago

Hello,

I have an issue of applying some font style, as you can see the font style existed but it reflected in the attached file. Below is the font style array

$header_style = array( 'borders' => array( 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), 'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), 'left' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), 'top' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), ), 'alignment' => array( 'wrap' => true, 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, ), 'font' => array( 'bold' => true, 'size' => 11,
'name' => 'Arial' ), 'fill' => array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'D9D9D9') ), );

and here is the code to apply the style

foreach ($sheet['styles'] as $style) { $objPHPExcel->getActiveSheet()->getStyle($style['cell'])->applyFromArray($style['style']); } PMF xti1j.xlsx