ReferenceTables

Tables operations

Table structure, layout, styling, and cell operations.

48 operations. Names, descriptions, and behavior flags come from the canonical contract.

Operations

tables.applyBorderPresetApply a border preset (e.g. all borders, outside only) to a table.mutatestables.applyPresetApply a named visual preset to a table. Presets: "grid" (1pt black borders all around), "minimal" (no outer borders, hairline grey row separators + thicker bottom), "striped" (banded rows on, 0.5pt grey borders), "accent" (filled header row + thick accent top/bottom; defaults to dark blue, override with `accentColor`). Composes set_borders + set_style_options + header-row shading in one call. Available via the document API and `superdoc_mutations` (intentionally NOT exposed as a top-level action on `superdoc_table`. Agents should compose explicit set_borders / set_shading / set_style_options calls so they always pick concrete colors that match the document context).mutatestables.applyStyleToggle conditional-format flags (header row, banded rows/columns, first/last column, last row) on a table. Pass `styleOptions` with the flags you want to set or clear (omitted flags stay unchanged). For "format the first row as a header" use `styleOptions: { headerRow: true }`. Optional `styleId` applies a named table style. Leave it unset unless you have a styleId from `superdoc_get_content` (no need to invent one).mutatestables.clearBorderRemove border formatting from a table or cell range.mutatestables.clearCellSpacingRemove custom cell spacing from the target table.mutatestables.clearContentsClear the contents of the target table or cell range.mutatestables.clearDefaultStyleRemove the document-level default table style setting.mutatestables.clearShadingRemove shading from a table or cell range.mutatestables.clearStyleRemove the applied table style, reverting to defaults.mutatestables.convertFromTextConvert a text range into a table.mutatestables.convertToTextConvert a table back to plain text.mutatestables.deleteDelete the target table from the document.mutatestrackedtables.deleteCellDelete a cell from a table row.mutatestables.deleteColumnDelete a column from the target table.mutatestrackedtables.deleteRowDelete a row from the target table.mutatestrackedtables.distributeColumnsDistribute column widths evenly across the target table.mutatestables.distributeRowsDistribute row heights evenly across the target table.mutatestables.getRetrieve table structure and dimensions by locator.readtables.getCellsRetrieve cell information for a table, optionally filtered by row or column.readtables.getPropertiesRetrieve layout and style properties of a table.readtables.getStylesList all table styles and the document-level default table style setting.readtables.insertCellInsert a new cell into a table row.mutatestables.insertColumnInsert a new column into the target table. The new column is cloned from an adjacent column, so it inherits the existing cell shading, borders, alignment, and width. No follow-up styling call is needed unless the new column should look different from the rest of the table.mutatestrackedtables.insertRowInsert a new row into the target table. The new row is cloned from an adjacent row, so it inherits the existing cell shading, borders, alignment, and padding. No follow-up styling call is needed unless the new row should look different from the rest of the table.mutatestrackedtables.mergeCellsMerge a range of table cells into one.mutatestables.moveMove a table to a new position in the document.mutatestables.moveRowMove a row to a new position within the same table. Available on v2-backed sessions only; v1-backed sessions currently return `CAPABILITY_UNAVAILABLE`.mutatestables.setAltTextSet the alternative text description for a table.mutatestables.setBorderSet border properties on a table or cell range.mutatestables.setBordersSet borders on a table using a target set or per-edge patch.mutatestables.setCellPaddingSet padding on a specific table cell or cell range.mutatestables.setCellPropertiesSet non-text properties on a single table cell: vertical alignment, text wrapping, fit-text, or preferred width. Requires a cell-level target (a tableCell block address with kind, nodeType, nodeId). Does NOT accept a table target with rowIndex/columnIndex. To set the text content of a cell, use action "set_cell_text" instead.mutatestables.setCellSpacingSet the cell spacing for the target table.mutatestables.setCellTextReplace the text content of a single table cell with plain text (one paragraph). Accepts either a direct cell locator (a tableCell block address with kind, nodeType, nodeId) OR a table target with rowIndex + columnIndex. Cell properties (vertical alignment, shading, borders, colspan/rowspan) are preserved. Use this for filling cells with values, replacing cell text, or populating empty tables. Much simpler than walking paragraphs and runs through superdoc_edit.mutatestables.setColumnWidthSet the width of a table column.mutatestables.setDefaultStyleSet the document-level default table style (w:defaultTableStyle in settings.xml).mutatestables.setLayoutSet the layout mode of the target table.mutatestrackedtables.setRowHeightSet the height of a table row.mutatestables.setRowOptionsSet options on a table row such as header repeat or page break.mutatestables.setShadingSet the background shading color on a table or cell range.mutatestables.setStyleApply a named table style to the target table, or clear the style when styleId is omitted.mutatestables.setStyleOptionToggle a conditional style option such as banded rows or first column.mutatestables.setTableOptionsSet table-level default cell margins and/or cell spacing.mutatestables.setTablePaddingSet default cell padding for the entire table.mutatestables.sortSort table rows by a column value.mutatestables.splitSplit a table into two tables at the target row.mutatestables.splitCellSplit a table cell into multiple cells.mutatestables.unmergeCellsUnmerge a previously merged table cell.mutates