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
{{ message }}
Repository navigation
Tables with incomplete columns are not parsed correctly #1193
The issue is caused by the fact that the class Table operates on a list of cells and uses arithmetic to calculate the element's index.
That approach only works for tables with the same number of columns in each row.
-->
Activity
tuv-jens-rutenkroeger commentedon Mar 23, 2023
The issue is caused by the fact that the class Table operates on a list of cells and uses arithmetic to calculate the element's index.
That approach only works for tables with the same number of columns in each row.
-->
python-docx/docx/table.py
Line 75 in 36cac78
fixed table issue python-openxml#1193
Implement python-openxml#1196 to fix python-openxml#1193
scanny commentedon May 1, 2024
This is fixed in the latest release v1.1.2 which enhanced aspects of Table support to accommodate rows with unequal numbers of cells.
Depending on what you're doing, the following approach may suit:
Note this does not tell the whole story because the same output would be produced by a table like this:
To maintain column integrity you will need an approach like this:
This new page in the docs is probably worth a read: https://python-docx.readthedocs.io/en/latest/user/tables.html