How do I have a different background for different columns while converting array data from PHP in to Excel?

Viewed 17

I have two arrays, I want to print both of them in a single excel sheet. but I want the excel background color of the values ​​in my first array to be red.

$xl = new PHPExcel();

$how = count($benzer_icerikler) + 2;

//this data excel red fill
$xl->getActiveSheet()->fromArray($benzer_icerikler, NULL, 'A1');
$xl->getActiveSheet()->fromArray($newArray, NULL, 'A'. $how);

$objWriter = PHPExcel_IOFactory::createWriter($xl, 'Excel2007');
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=Export.xlsx");
$objWriter->save('mergedBooks2.xlsx');
die; 
0 Answers
Related