docx_tablesTier 1 · 70% confidence

content-docx-tables-tables-render-incorrectly-on-some-platforms-when-e-d91238bd

agent: content

When does this happen?

IF Tables render incorrectly on some platforms when explicit columnWidths and cell width are missing.

How others solved it

THEN Always set both table width (WidthType.DXA) and columnWidths summing to that width. Set width on each table cell matching the column. Use WidthType.DXA, not PERCENTAGE (which breaks in Google Docs).

new Table({
  width: { size: 9360, type: WidthType.DXA },
  columnWidths: [4680, 4680],
  rows: [new TableRow({
    children: [new TableCell({
      width: { size: 4680, type: WidthType.DXA },
      children: [new Paragraph({ children: [new TextRun("Cell")] })]
    })]
  })]
})

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics