diff --git a/CHANGELOG.md b/CHANGELOG.md index 975c0ffd..62680f62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Fixed - FLOOR() function accept negative number and negative significance [#1245](https://github.com/PHPOffice/PhpSpreadsheet/pull/1245) +- Correct column style even when using rowspan [#1249](https://github.com/PHPOffice/PhpSpreadsheet/pull/1249) ## [1.10.0] - 2019-11-18 diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php index 90c06a79..b500d3ae 100644 --- a/src/PhpSpreadsheet/Reader/Html.php +++ b/src/PhpSpreadsheet/Reader/Html.php @@ -490,13 +490,13 @@ class Html extends BaseReader case 'td': $this->processDomElement($child, $sheet, $row, $column, $cellContent); - // apply inline style - $this->applyInlineStyle($sheet, $row, $column, $attributeArray); - while (isset($this->rowspan[$column . $row])) { ++$column; } + // apply inline style + $this->applyInlineStyle($sheet, $row, $column, $attributeArray); + $this->flushCell($sheet, $column, $row, $cellContent); if (isset($attributeArray['rowspan'], $attributeArray['colspan'])) { diff --git a/tests/PhpSpreadsheetTests/Reader/HtmlTest.php b/tests/PhpSpreadsheetTests/Reader/HtmlTest.php index 150793a0..c692e537 100644 --- a/tests/PhpSpreadsheetTests/Reader/HtmlTest.php +++ b/tests/PhpSpreadsheetTests/Reader/HtmlTest.php @@ -403,4 +403,25 @@ class HtmlTest extends TestCase $actual = $spreadsheet->getActiveSheet()->getMergeCells(); self::assertSame(['A2:C2' => 'A2:C2'], $actual); } + + public function testTextIndentUseRowspan() + { + $html = ' + + + + + + + + + +
1Center AlignRow
2Text Indent
'; + $filename = $this->createHtml($html); + $spreadsheet = $this->loadHtmlIntoSpreadsheet($filename); + $firstSheet = $spreadsheet->getSheet(0); + $style = $firstSheet->getCell('C2')->getStyle(); + self::assertEquals(10, $style->getAlignment()->getIndent()); + unlink($filename); + } }