r7_table
Create, inspect, or modify DOCX tables: add and remove rows and columns, merge cells, set column widths, and format individual cells without altering neighbouring cells.
Instructions
Create, inspect, or modify tables in DOCX documents: add and remove rows and columns, merge and unmerge cells, set column widths, and format individual cells (shading, borders, alignment, width). Cell formatting never rewrites the text or the properties of neighbouring cells.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cell | No | Cell coordinate and properties for setCell/formatCell. | |
| rows | No | 2D array of rows and cell values for create/addRow. A cell may be a string or an object with the cell properties. | |
| index | No | Insertion index for addRow/addColumn. | |
| merge | No | Merge block for the merge/unmerge actions. | |
| action | Yes | Table action. "merge" and "unmerge" take merge { row, col, rows, cols }. | |
| values | No | Row (addRow) or column (addColumn) cell values. | |
| widths | No | Alias of widthsTwips. | |
| borders | No | Table borders for create: false for none, or { top, left, bottom, right, insideH, insideV } with { style, sizePoints, color }. | |
| shading | No | Shading applied to every new cell of addRow/addColumn. | |
| filePath | Yes | Path to the DOCX file. | |
| position | No | Position when creating a table. | |
| rowIndex | No | Row to remove. | |
| alignment | No | Alignment for new cells, or for the whole new table. | |
| outputPath | No | Optional target path. | |
| tableIndex | No | 0-based table index for existing tables. | |
| columnIndex | No | Column to remove or where to insert one. | |
| fixedLayout | No | For setColumnWidths: pin the layout so the widths are honoured (default true). | |
| widthsTwips | No | Column widths in twips for create/setColumnWidths (and per-cell widths for addRow). | |
| includeStyles | No | For inspect: also return normalized cell formatting (widths, merges, shading, borders, alignment). | |
| verticalAlign | No | Vertical alignment for new cells. |