Read background color of cells from HTML file

If a <td> in HTML has a bgcolor attribute, it is then applied to the spreadsheet file
This commit is contained in:
jacobsreynolds 2016-10-26 12:52:04 -05:00 committed by Adrien Crivelli
parent ab7aa68300
commit 720fb3eff5
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 9 additions and 0 deletions

View File

@ -466,6 +466,15 @@ class HTML extends BaseReader implements IReader
}
$sheet->mergeCells($column . $row . ':' . $columnTo . $row);
$column = $columnTo;
} elseif (isset($attributeArray['bgcolor'])) {
$sheet->getStyle($column . $row)->applyFromArray(
[
'fill' => [
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'color' => ['rgb' => $attributeArray['bgcolor']],
],
]
);
}
++$column;
break;