diff --git a/src/file/table/table-column.spec.ts b/src/file/table/table-column.spec.ts index eef7a2dfc9..aa031423a3 100644 --- a/src/file/table/table-column.spec.ts +++ b/src/file/table/table-column.spec.ts @@ -43,7 +43,9 @@ describe("TableColumn", () => { }); const tree2 = new Formatter().format(cells[1]); - expect(tree2).to.deep.equal({ "w:tc": [{ "w:p": EMPTY_OBJECT }] }); + expect(tree2).to.deep.equal({ + "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], + }); const tree3 = new Formatter().format(cells[2]); expect(tree3).to.deep.equal({ diff --git a/src/file/table/table-column.ts b/src/file/table/table-column.ts index b06a9f29a4..5752bde472 100644 --- a/src/file/table/table-column.ts +++ b/src/file/table/table-column.ts @@ -15,7 +15,10 @@ export class TableColumn { public mergeCells(startIndex: number, endIndex: number): TableCell { this.cells[startIndex].addVerticalMerge(VMergeType.RESTART); - this.cells[endIndex].addVerticalMerge(VMergeType.CONTINUE); + + for (let i = startIndex + 1; i <= endIndex; i++) { + this.cells[i].addVerticalMerge(VMergeType.CONTINUE); + } return this.cells[startIndex]; }