DOCXKIT_TABLE_INVALID_COLUMNS: Invalid table grid
The table has no columns or contains invalid, overlapping, or out-of-range spans.
What to do
- Define at least one column.
- 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
code:TABLE_INVALID_COLUMNSdiagnosticCode:DOCXKIT_TABLE_INVALID_COLUMNSname:DocxKitErrordocs: https://docx-kit.ntnyq.dev/errors/docxkit_table_invalid_columns/
Example message
text
Table must have at least one column