PHPExcel을 사용하여 내 서버에서 일부 시트를 생성하고 있습니다. 더 많거나 적게 다 잘 작동하지만, 일부 행 (매 두 번째 행, 그래서 목록을 쉽게 읽을 수있을) 색을하려고 할 때 재미있는 것을 얻을 : 행이 채색되지 않습니다 있지만 채워지지 않은 셀에만 행운을 빕니다. 데이터. 데이터로 채워진 셀은 흰색으로 유지됩니다.PHPExcel : 세포를 채색하고 있습니까?
여기에 내가 뭘 잘못
$ind = ($ind + 1) % 2;
if($ind == 1)
{
$style_header = array(
'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'color' => array('rgb'=>'CCC'),
),
'font' => array(
'bold' => true,
)
);
$sheet->getStyle($row)->applyFromArray($style_header);
}
$sheet->getCellByColumnAndRow(0, $row)->setValue($item['qty']);
$sheet->getCellByColumnAndRow(1, $row)->setValueExplicit($item['name']);
$sheet->getCellByColumnAndRow(2, $row)->setValueExplicit($item['size']);
$sheet->getCellByColumnAndRow(3, $row)->setValueExplicit($item['color']);
을 사용하여 코드입니까?
이봐 , 감사를 얻을 수 있으며, $ 시트 -> 및 getStyle ('A $ 행 : D의 $ 행')는 큰했다. 왜 다른 방식으로 작동하지 않을지 모르지만 더 이상 중요하지 않습니다. – Relja
문제 없으니 도움이 되니 기쁩니다. –