diff --git a/src/spout/SpoutBuilder.php b/src/spout/SpoutBuilder.php index dae1e74..3d420fa 100644 --- a/src/spout/SpoutBuilder.php +++ b/src/spout/SpoutBuilder.php @@ -348,6 +348,14 @@ class SpoutBuilder extends AbstractBuilder { } function _write(array $row, ?array $colStyles=null, ?array $rowStyle=null): void { + $rowParams = null; + if ($rowStyle !== null) { + foreach (array_keys(ref_params::ROW) as $method) { + $value = $rowStyle[$method] ?? null; + unset($rowStyle[$method]); + if ($value !== null) $rowParams[$method] = $value; + } + } $sheetParams = $this->sheetParams; $headerStyle = $sheetParams["header_style"] ?? null; $oddStyle = $sheetParams["odd_style"] ?? null; @@ -379,7 +387,9 @@ class SpoutBuilder extends AbstractBuilder { } $rowStyle ??= $oddStyle; self::ensure_style($rowStyle); - $this->writer->addRow(WriterEntityFactory::createRow($cells, $rowStyle)); + $row = WriterEntityFactory::createRow($cells, $rowStyle); + self::apply_params($row, $rowParams, ref_params::ROW); + $this->writer->addRow($row); if ($differentOddEven) $this->oddEvenIndex++; } diff --git a/src/spout/ref_params.php b/src/spout/ref_params.php index 7027395..89e3a2f 100644 --- a/src/spout/ref_params.php +++ b/src/spout/ref_params.php @@ -24,6 +24,10 @@ class ref_params { "different_odd_even" => "bool", ]; + const ROW = [ + "->setHeight" => ["float"], + ]; + const COLORS = [ "black" => Color::BLACK, "white" => Color::WHITE,