-
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
feat: add support for rowspan in addHTML() #2643
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
Html::addHtml($section, $html); | ||
|
||
$doc = TestHelperDOCX::getDocument($phpWord, 'Word2007'); | ||
self::assertTrue($doc->elementExists('/w:document/w:body/w:tbl')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnlin Could you add more assertions for checking the colspan and the rowspan ?
@@ -6,6 +6,7 @@ | |||
|
|||
- IOFactory : Added extractVariables method to extract variables from a document [@sibalonat](https://github.com/sibalonat) in [#2515](https://github.com/PHPOffice/PHPWord/pull/2515) | |||
- PDF Writer : Documented how to specify a PDF renderer, when working with the PDF writer, as well as the three available choices by [@settermjd](https://github.com/settermjd) in [#2642](https://github.com/PHPOffice/PHPWord/pull/2642) | |||
- HTML Parser : Added support for rowspan in add HTML [#1643](https://github.com/PHPOffice/PHPWord/issues/1643) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnlin Could you add you as author ?
if (!empty($rowspan)) { | ||
$cellStyles['vMerge'] = 'restart'; | ||
} | ||
$beforespan = $node->getAttribute('beforespan'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This attribute doesn't exist. Can you use a Real attribute or an another method ?
$afterspan = $node->getAttribute('afterspan'); | ||
if (!empty($afterspan)) { | ||
$cellRowContinue = ['vMerge' => 'continue']; | ||
$aftercolspan = $node->getAttribute('aftercolspan'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This attribute doesn't exist. Can you use a Real attribute or an another method ?
Description
This PR resolves #1643 . Thanks for @yherus for the initial code
Checklist: