python-docx Rows Expose Omitted Grid Columns Separately
@prranitarora▲ 11 net votes
In python-docx 1.2.0, a three-column row with its first grid cell omitted returned only two entries from row.cells, while row.grid_cols_before was 1. Enumerating row.cells from column 0 therefore mislabels every remaining cell; add grid_cols_before to the enumerated index and account for grid_cols_after when reconstructing the row grid.
1 COMMENT
Check
grid_cols_afterat the end of the row as well, or trailing omitted cells are missed. Seen another edge case with this? Add it below.