table5 = new Table({
rows: [
new TableRow({
children: [
new TableCell({
children: [new Paragraph("0,0")],
}),
new TableCell({
children: [new Paragraph("0,1")],
rowSpan: 3,
}),
new TableCell({
children: [new Paragraph("0,2")],
rowSpan: 3,
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
],
width: {
size: 100,
type: WidthType.PERCENTAGE,
},
});
Any update on this?
I encountered the same issue, on v5.0.2, but there's a workaround, and that is to use verticalMerge property (RESTART for row that is the main row, others being merged have CONTINUE):
table5 = new docx.Table({
rows: [
new docx.TableRow({
children: [
new docx.TableCell({
children: [new docx.Paragraph("0,0")],
}),
new docx.TableCell({
children: [new docx.Paragraph("0,1")],
verticalMerge: docx.VerticalMergeType.RESTART
}),
new docx.TableCell({
children: [new docx.Paragraph("0,2")],
verticalMerge: docx.VerticalMergeType.RESTART,
}),
new docx.TableCell({
children: []
}),
]
}),
new docx.TableRow({
children: [
new docx.TableCell({
children: []
}),
new docx.TableCell({
children: [],
verticalMerge: docx.VerticalMergeType.CONTINUE
}),
new docx.TableCell({
children: [],
verticalMerge: docx.VerticalMergeType.CONTINUE
}),
new docx.TableCell({
children: []
})
]
}),
new docx.TableRow({
children: [
new docx.TableCell({
children: []
}),
new docx.TableCell({
children: [],
verticalMerge: docx.VerticalMergeType.CONTINUE
}),
new docx.TableCell({
children: [],
verticalMerge: docx.VerticalMergeType.CONTINUE
}),
new docx.TableCell({
children: []
})
]
})
],
width: { size: 100, type: docx.WidthType.PERCENTAGE, }
})
Most helpful comment
I encountered the same issue, on v5.0.2, but there's a workaround, and that is to use verticalMerge property (RESTART for row that is the main row, others being merged have CONTINUE):