Set Background cell color in PHPExcel phpexcel How to set specific color to active cell when creating XLS document in PHPExcel? Best Answer $sheet->getStyle('A1')->applyFromArray( array( 'fill' => array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'FF0000') ) ) ); Source: http://bayu.freelancer.web.id/2010/07/16/phpexcel-advanced-read-write-excel-made-simple/ Related SolutionsPHPExcel how to set cell value dynamically I asume you have connected to your database already. $sql = "SELECT * FROM my_table"; $result = mysql_query($sql); $row = 1; // 1-based index while($row_data = mysql_fetch_assoc($result)) { $col = 0; foreach($row_data as $key=>$value) { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $row, $value); $col++; } $row++; } Php – How to set auto height in phpexcel $excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); Should set the row height to 'auto' for row 1. Related TopicPhp – Setting width of spreadsheet cell using PHPExcelPhp – Merge Cell values with PHPExcel – PHPPHPExcel: How to get a CELL COLORPHPExcel color to specific rowR – Generic Containers in Delphi
Best Answer
Source: http://bayu.freelancer.web.id/2010/07/16/phpexcel-advanced-read-write-excel-made-simple/