Cell alignment
This PR adds support for cell alignment for XLSX and ODS files.
You can now align the content of the cells this way:
```
use Box\Spout\Common\Entity\Style\CellAlignment;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
$style = (new StyleBuilder())
->setCellAlignment(CellAlignment::RIGHT)
->build();
...
```
Possible cell alignments are: LEFT, RIGHT, CENTER and JUSTIFY.
This commit is contained in:
1 parent
0a0b1f7196
commit
9f4c094fa0
12 files changed
+246
-46
No files matched your search
@@ -45,6 +45,7 @@ class StyleMergerTest extends TestCase
|
||||
->setFontBold()
|
||||
->setFontColor(Color::YELLOW)
|
||||
->setBackgroundColor(Color::BLUE)
|
||||
->setFormat('0.00')
|
||||
->build();
|
||||
$currentStyle = (new StyleBuilder())->setFontName('Font')->setFontUnderline()->build();
|
||||
$mergedStyle = $this->styleMerger->merge($currentStyle, $baseStyle);
|
||||
@@ -60,6 +61,7 @@ class StyleMergerTest extends TestCase
|
||||
$this->assertTrue($mergedStyle->isFontUnderline());
|
||||
$this->assertEquals(Color::YELLOW, $mergedStyle->getFontColor());
|
||||
$this->assertEquals(Color::BLUE, $mergedStyle->getBackgroundColor());
|
||||
$this->assertEquals('0.00', $mergedStyle->getFormat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user