docx icon indicating copy to clipboard operation
docx copied to clipboard

Space in TableCell, when used Table in TableCell. Its problem only in google document

Open jerryk1925 opened this issue 2 years ago • 6 comments

Thank you for raising an issue to docx

Hi, i have problem, when i used new Table inside new TableCell, arounde Table create free space, for example used this code Its problem only in google docs.

new TableCell({
  columnSpan: 2,
  width: {
    size: 5453.85,
    type: WidthType.DXA,
  },
  children: [
    new Table({
      rows: [
        new TableRow({
          children: [
            new TableCell({ children: [new Paragraph({ children: [textBase({ text: '123' })] })] }),
          ],
        }),
      ],
    }),

image

jerryk1925 avatar Feb 16 '23 17:02 jerryk1925

hi @jerryk1925 try to add a width to your table like

new Table ({ ... width: { size: '100%', type: WidthType.PERCENTAGE }, ... })

hope this could help you!

damian-garrido avatar Mar 02 '23 19:03 damian-garrido

You can view it correctly only on Microsoft Word it seems

CarrionB avatar Apr 15 '23 04:04 CarrionB

@jerryk1925 did you solve this issue?

I'm facing the same issue, I'm working on a Mac, this issue happens on Pages as in Google Docs. I don't have access to MS Word to check it there :(

filoscoder avatar Apr 29 '23 17:04 filoscoder

no i cant fix this problem(

jerryk1925 avatar Apr 30 '23 18:04 jerryk1925

@jerryk1925 did you solve this issue?

I'm facing the same issue, I'm working on a Mac, this issue happens on Pages as in Google Docs. I don't have access to MS Word to check it there :(

I think you can access to Microsoft Word online with an outlook account, you may check it.

CarrionB avatar May 01 '23 16:05 CarrionB

Hey @jerryk1925 @CarrionB @filoscoder https://github.com/dolanmiu/docx/issues/216 has the correct fix for this. You need to set the table with columnWidths and make sure the TableCell width matches that.

aldenho52 avatar Jan 10 '24 20:01 aldenho52