Skip to content

DOCXKIT_TABLE_INVALID_COLUMNS: Invalid table grid ​

The table has no columns or contains invalid, overlapping, or out-of-range spans.

What to do ​

  1. Define at least one column.
  2. Keep rowSpan and colSpan within the grid and remove overlapping cell positions.

Problem example ​

ts
// Invalid table grid: no columns.
const columns = []

Corrected example ​

ts
import { createDocx } from 'docx-kit'

const blob = await createDocx().table({
  columns: [{ key: 'name', title: 'Name' }],
  data: [{ name: 'Ada' }],
}).toBlob()

Common causes ​

  • Empty columns or cell spans that exceed or overlap the table grid.

Diagnostic fields ​

Example message ​

text
Table must have at least one column

Released under the MIT License.