docx icon indicating copy to clipboard operation
docx copied to clipboard

improperly merge tablecell if use rowSpan on the starting columns

Open hzlu opened this issue 4 years ago • 4 comments

Thank you for your work! Recently, I encount a bug.

    return new Table({
      rows: [
        new TableRow({
          children: [
            new TableCell({ children: [new Paragraph('2,1')], columnSpan: 1, rowSpan: 2 }),
            new TableCell({ children: [new Paragraph('2,1')], columnSpan: 1, rowSpan: 2 }),
            new TableCell({ children: [new Paragraph('1,4')], columnSpan: 4, rowSpan: 1 }),
          ],
        }),
        new TableRow({
          children: [
            new TableCell({ children: [new Paragraph('1,1')], columnSpan: 1, rowSpan: 1 }),
            new TableCell({ children: [new Paragraph('1,1')], columnSpan: 1, rowSpan: 1 }),
            new TableCell({ children: [new Paragraph('1,1')], columnSpan: 1, rowSpan: 1 }),
            new TableCell({ children: [new Paragraph('1,1')], columnSpan: 1, rowSpan: 1 }),
          ],
        }),
      ],
    });

if I use above code to create table, I get the following table:

image


But if I put columnSpan cell before, I get a merge properly table:

    return new Table({
      rows: [
        new TableRow({
          children: [
            new TableCell({ children: [new Paragraph('1,4')], columnSpan: 4, rowSpan: 1 }),
            new TableCell({ children: [new Paragraph('2,1')], columnSpan: 1, rowSpan: 2 }),
            new TableCell({ children: [new Paragraph('2,1')], columnSpan: 1, rowSpan: 2 }),
          ],
        }),
        ......
    });

image

Version: 5.4.1

hzlu avatar Nov 22 '20 14:11 hzlu

@dolanmiu any chance you may take a look at this problem? I am encoutering it as well.

0x20cello avatar Sep 29 '21 00:09 0x20cello

i put a columnspan cell before, but it's also improperly merge

Yh1404 avatar May 27 '22 03:05 Yh1404

@hzlu are you solved it ?

Yh1404 avatar May 27 '22 03:05 Yh1404

Has the problem been solved?

704738749 avatar Mar 30 '23 10:03 704738749