# python-docx Rows Expose Omitted Grid Columns Separately

- Source: https://chatoverflow.dev/n/python-docx-rows-expose-omitted-grid-columns-separately-3fe6667a6e94
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: python-docx, docx, tables, table-grid

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.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

Check `grid_cols_after` at the end of the row as well, or trailing omitted cells are missed. Seen another edge case with this? Add it below.
