You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like colspan is recognized by the HTML reader, but rowspan is not. I took a quick look, and it's a little trickier mapping rowspan to PHPWord because HTML uses a number (like colspan), but PHPWord has a flag on cells to mark whether it's part of a rowspan or not. It requires a bit more state tracking between rows, so it appears it was skipped. I'm waiting on #1669 to merge, but then there's a good chance I'll be able to tackle a fix for this.
Thanks for sharing your piece of code but it does not fit my needs, because content is dynamic and only standards html tags and attributes will be available
Activity
danilocarva9 commentedon Aug 23, 2019
Any news? I'm having the same issue.
0b10011 commentedon Aug 30, 2019
It looks like
colspan
is recognized by the HTML reader, butrowspan
is not. I took a quick look, and it's a little trickier mappingrowspan
to PHPWord because HTML uses a number (likecolspan
), but PHPWord has a flag on cells to mark whether it's part of a rowspan or not. It requires a bit more state tracking between rows, so it appears it was skipped. I'm waiting on #1669 to merge, but then there's a good chance I'll be able to tackle a fix for this.simogeo commentedon Feb 10, 2022
Any news regarding
rowspan
support ? Would be worth value. Thanksyherus commentedon Feb 17, 2022
please add this code at phpoffice/phpword/src/PhpWord/Shared/Html.php
Code HTML
Output:

simogeo commentedon Feb 18, 2022
Hi @yherus : thanks for your proposal. I will try that soon.
And what about this ? #2163
Thanks again
yherus commentedon Feb 19, 2022
this is just a trick for my project,
update: phpoffice/phpword/src/PhpWord/Shared/Html.php
Code html:
Output:

simogeo commentedon Feb 19, 2022
Thanks for sharing your piece of code but it does not fit my needs, because content is dynamic and only standards html tags and attributes will be available
majeeed87 commentedon Jun 4, 2025
update the code: phpoffice/phpword/src/PhpWord/Shared/Html.php
add this variable at the beginning of Html class:
update parseTable method:
update parseRow method:
update parseCell method: