@@ -443,22 +443,22 @@ |
||
443 | 443 | $this->processDomElement($child, $sheet, $row, $column, $cellContent); |
444 | 444 | |
445 | 445 | // add color styles (background & text) from dom element,currently support : td & th, using ONLY inline css style with RGB color |
446 | - if (isset($attributeArray['style'])){ |
|
447 | - $styles = explode(';',$attributeArray['style']); |
|
446 | + if (isset($attributeArray['style'])) { |
|
447 | + $styles = explode(';', $attributeArray['style']); |
|
448 | 448 | foreach ($styles as $st) { |
449 | 449 | $value = explode(':', $st); |
450 | 450 | if (!empty($value[0])) { |
451 | - if(trim($value[0])=="background-color" || trim($value[0])=="color" ) { |
|
451 | + if (trim($value[0]) == "background-color" || trim($value[0]) == "color") { |
|
452 | 452 | $style_color = null; |
453 | 453 | //check if has #, so we can get clean hex |
454 | - if ( substr(trim($value[1]), 0, 1) == "#" ) { |
|
454 | + if (substr(trim($value[1]), 0, 1) == "#") { |
|
455 | 455 | $style_color = substr(trim($value[1]), 1); |
456 | 456 | } |
457 | - if($style_color) { |
|
457 | + if ($style_color) { |
|
458 | 458 | if (trim($value[0]) == "background-color") { |
459 | - $sheet->getStyle($column . $row)->applyFromArray( ['fill' => ['type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,'color' => ['rgb' => "{$style_color}" ],], ] ); |
|
459 | + $sheet->getStyle($column . $row)->applyFromArray(['fill' => ['type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'color' => ['rgb' => "{$style_color}"], ], ]); |
|
460 | 460 | } elseif (trim($value[0]) == "color") { |
461 | - $sheet->getStyle($column . $row)->applyFromArray( ['font' => ['color' => [ 'rgb' => "$style_color}" ]], ]); |
|
461 | + $sheet->getStyle($column . $row)->applyFromArray(['font' => ['color' => ['rgb' => "$style_color}"]], ]); |
|
462 | 462 | } |
463 | 463 | } |
464 | 464 | } |