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

Reading Nested Table #571

Closed
mathieuweber opened this issue Jul 8, 2015 · 0 comments · Fixed by #2355
Closed

Reading Nested Table #571

mathieuweber opened this issue Jul 8, 2015 · 0 comments · Fixed by #2355

Comments

@mathieuweber
Copy link

mathieuweber commented Jul 8, 2015

I am using PHPWord (v0.12.0) to parse Word documents.

I don't know if it is on purpose, but PHPWord does not read nested tables.

I just wrote a hack in the PhpWord\Reader\Word2007\AbstractPart.php on line 300

foreach ($cellNodes as $cellNode) {
    if ($cellNode->nodeName == 'w:p') { // Paragraph
        $this->readParagraph($xmlReader, $cellNode, $cell, $docPart);
    }
//@hack MW
    if ($cellNode->nodeName == 'w:tbl') { // Table
        $this->readTable($xmlReader, $cellNode, $cell, $docPart);
    }
}

It seems to work just fine.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

brianakidd added a commit to brianakidd/PHPWord that referenced this issue May 6, 2020
kvush pushed a commit to Carvago/PHPWord that referenced this issue Oct 25, 2021
janatjak pushed a commit to Carvago/PHPWord that referenced this issue Jul 12, 2022
Dachande663 pushed a commit to Dachande663/PHPWord that referenced this issue Dec 8, 2022
This commit re-adds supports for nested tables as provided by @mathieuweber  in PR PHPOffice#571
PowerKiKi pushed a commit that referenced this issue May 30, 2023
This commit re-adds supports for nested tables as provided by @mathieuweber  in PR #571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants