Open
Description
In python-docx
, attempting to delete a column from a simple table (created via python-docx itself) causes cell misalignment or destruction of the table structure.
Environment:
- No merged cells
- No nested elements
- Uniform number of columns in all rows
- Tables created with
docx.Document().add_table()
Steps to reproduce:
- Create a 5-column table
- Populate with plain text
- Attempt to remove column 3 using:
row._tr.remove(row.cells[2]._tc)
Result:
- Table becomes malformed
- Some rows have fewer cells
- In MS Word, rendering is broken
Expected:
- Clean removal of the column with remaining structure preserved
This seems to be a long-standing limitation, but it now affects even simple programmatically generated documents. Please consider addressing this bug or documenting a safe workaround.
Metadata
Metadata
Assignees
Labels
No labels