-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML text-align style not working when using addHtml() #2115
Comments
Found this does not work either - no indentation or italic text <p style="padding-left: 50px;padding-right: 50px;font-style: italic;">' . trim($matches[1]) . '</p> Using these did not work either <center> and <i> BUT found <sup style="vertical-align: super;"sup>ABCsup</sup> worked |
For text-align in h1 tags use a p tag instead. |
Any news about this issue, the alignment is not applied on all the heading! |
Describe the Bug
HTML text-align style not working.
Steps to Reproduce
PHP
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment;filename="test.docx"');
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('php:https://output');
HTML
<h1 style="line-height: 23px;text-align: center;font-size: 20px;">Chapter 27</h1>
Expected Behavior
Text to be centred.
Also text-align:right no recognised.
Current Behavior
Text is left aligned
Context
The text was updated successfully, but these errors were encountered: