Replies: 2 comments 1 reply
-
Not quite as straightforward: Vertical Alignment is the Horizontal Alignment is the |
Beta Was this translation helpful? Give feedback.
-
@MarkBaker
With For vertical alignment I placed after line 336 of original file (not tested yet):
OFFTOPIC: What can I do to receive notifications about this discussion? GitHub stated: You’re receiving notifications because you authored the thread. but I didn't receive anything. Should I place a beta feedback? |
Beta Was this translation helpful? Give feedback.
-
Hi,
after some investigations to align cells horizontally centered I found out, that no alignment handling is implemented in
\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Ods\Content.php
To handle alignment I added some lines after line number 285:
// Align
$hAlign = $style->getAlignment()->getHorizontal();
$vAlign = $style->getAlignment()->getVertical();
if (!empty($hAlign) || !empty($vAlign)) {
$writer->startElement('style:paragraph-properties');
if (!empty($hAlign))
$writer->writeAttribute('fo:text-align', $hAlign);
if (!empty($vAlign))
$writer->writeAttribute('fo:vertical-align', $vAlign);
$writer->endElement();
}
Seems to work well, so I would like to see this included in the code.... ;-)
Regards
Beta Was this translation helpful? Give feedback.
All reactions