From 180ad168cbb739b4fb6be7bca59c591b30e8742e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 7 Dec 2014 23:45:15 +0000 Subject: [PATCH] Additional minor tweaks to HTML reader for merged cells --- Classes/PHPExcel/Reader/HTML.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Reader/HTML.php b/Classes/PHPExcel/Reader/HTML.php index df389e7..103c2c6 100644 --- a/Classes/PHPExcel/Reader/HTML.php +++ b/Classes/PHPExcel/Reader/HTML.php @@ -403,8 +403,8 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ } } - //create merging rowspan if (isset($attributeArray['rowspan']) && isset($attributeArray['colspan'])) { + //create merging rowspan and colspan $columnTo = $column; for ($i = 0; $i < $attributeArray['colspan'] - 1; $i++) { ++$columnTo; @@ -414,13 +414,16 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ $this->rowspan[$value] = true; } $sheet->mergeCells($range); + $column = $columnTo; } elseif (isset($attributeArray['rowspan'])) { + //create merging rowspan $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1); foreach (\PHPExcel_Cell::extractAllCellReferencesInRange($range) as $value) { $this->rowspan[$value] = true; } $sheet->mergeCells($range); } elseif (isset($attributeArray['colspan'])) { + //create merging colspan $columnTo = $column; for ($i = 0; $i < $attributeArray['colspan'] - 1; $i++) { ++$columnTo;