Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jnlin
Copy link

@jnlin jnlin commented Aug 7, 2024

Description

This PR resolves #1643 . Thanks for @yherus for the initial code

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

@coveralls
Copy link

coveralls commented Aug 7, 2024

Coverage Status

coverage: 97.181% (-0.03%) from 97.208%
when pulling da62475 on WritePath:rowspan
into f9ce804 on PHPOffice:master.

Copy link
Member

@Progi1984 Progi1984 left a 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'));
Copy link
Member

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)
Copy link
Member

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');
Copy link
Member

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');
Copy link
Member

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 ?

@Progi1984 Progi1984 added the Status: Waiting for feedback Question has been asked, waiting for response from PR author label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting for feedback Question has been asked, waiting for response from PR author
Development

Successfully merging this pull request may close these issues.

Is there any support for rowspan and colspan in addHTML ?
4 participants