question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get row.cells from table object

See original GitHub issue

I’m trying to iterate over tables to get the text from each of the cells, but after getting the rows of the table and iterating over each row, row.cells is throwing an exception:

docx.oxml.exceptions.InvalidXmlError: required <w:tblGrid> child element not present

I’ve looked in document.xml file and noticed that it doesn’t have w:tblGrid. Is this incompatible? Or is there another way I can get to the values of each cell? The hierarchy is: w:tbl -> w:tr -> w:tc -> w:p -> w:r -> w:t <- this is where the value is in the first cell of the first row

I’m just trying to figure out if this file I’m parsing is compatible or not.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
scannycommented, Sep 8, 2021

Glad you got it working 😃

0reactions
u84sixcommented, Sep 8, 2021

What I did was open with Word and select “Open and Repair”. Then saved as new file and fix the issues. Thanks for the tip. I diffed the original file and new file (document.xml) and there are tons of differences. So I’ll have to take a look at the doc gen code we use and see how to apply the latest schema. Thanks for the help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting value from table cell in JavaScript...not jQuery
Yes, the first line is using jQuery. The question explicitly states that they can't use jQuery. – Hoppeduppeanut. Jul 2, 2020 at 5:22....
Read more >
Excel Table Column/Row Selection not working
The fix is to check the "select locked cells" box in order for the feature to return, whether the sheet is protected or...
Read more >
HTMLTableElement.rows - Web APIs - MDN Web Docs
The read-only HTMLTableElement property rows returns a live HTMLCollection of all the rows in the table, including the rows contained within ...
Read more >
HTML DOM Table cells Collection
Find out how many cells there are in the first row in a table: ... item(index), Returns the <td> and/or <th> element from...
Read more >
Add or delete a table in Pages on Mac
In Pages on your Mac, add a new table, create a table from existing cells, copy and paste a table, or delete a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found