docx.merge_cells
docx.merge_cells(doc, table, row1, col1, row2, col2)
Input: doc, table, row1, col1, row2, col2 · Output: no output
What it is
Merges the rectangle of cells from (row1,col1) to (row2,col2), inclusive and 0-based, into one cell (a column span across, a vertical merge down). The top-left cell's formatting wins and the other cells' text follows it, one paragraph each (empty ones dropped). Columns are *grid* columns -- the columns docx.tables shows until cells are merged. A range that cuts through an existing merged cell is refused. *Added in v0.4.7*
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
docx.merge_cells(doc, table, row1, col1, row2, col2) | doc —not documented yettable —not documented yetrow1 —Merges the rectangle of cells from (row1,col1) to (row2,col2), inclusive and 0-based, into one cell (a column span across, a vertical merge down).col1 —Merges the rectangle of cells from (row1,col1) to (row2,col2), inclusive and 0-based, into one cell (a column span across, a vertical merge down).row2 —Merges the rectangle of cells from (row1,col1) to (row2,col2), inclusive and 0-based, into one cell (a column span across, a vertical merge down).col2 —Merges the rectangle of cells from (row1,col1) to (row2,col2), inclusive and 0-based, into one cell (a column span across, a vertical merge down). | not documented yet | The top-left cell's formatting wins and the other cells' text follows it, one paragraph each (empty ones dropped). Columns are *grid* columns -- the columns docx.tables shows until cells are merged. A range that cuts through an existing merged cell is refused. *Added in v0.4.7*. |
Examples
No documentation example calls this form yet. The File I/O chapter is where one belongs.