ReferenceTables
Tables operations
Table structure, layout, styling, and cell operations.
50 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 table style preset to a table. Word presets (IDs starting with "word.", such as "word.grid-table-4-accent-1") install the built-in Word table style definition into the document when needed and reference it from the table, so the result opens in Word as that named style and follows the document theme. Call tables.listPresets first to get valid preset IDs. Use the "-accent-N" variants for theme accent colors; accentColor is rejected for Word presets. Optional styleOptions set the header row, last row, first column, last column, banded rows, and banded columns flags; omitted flags keep the table's current settings. Word presets remove table-level borders and shading so the style governs them; direct cell or run formatting is preserved and can override the style. In real-time collaboration every client receives the style definition and the table change together. Word presets are direct edits only: tracked mode returns CAPABILITY_UNAVAILABLE. SuperDoc convenience presets "grid", "minimal", "striped", and "accent" keep their existing behavior: they write direct borders, banding, and header shading (accentColor overrides the "accent" color). Use tables.applyStyle instead to reference a style ID that already exists in the document (see tables.getStyles).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 consecutive paragraphs from a starting block, or exactly the whole paragraphs in a selection, into a table. Selection endpoints must be at paragraph boundaries.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, style, and authored row and grid column dimensions 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.listPresetsList built-in table style presets that tables.applyPreset accepts: 105 Word table styles (Table Grid, Grid Table Light, Plain Table 1-5, and the Grid Table and List Table designs 1-7 with neutral and Accent 1-6 variants) plus the four SuperDoc convenience presets. Filter by source ("word" or "superdoc"), group ("plain", "grid", "list", "convenience"), or a query matching IDs, names, or appearance terms (shading, banded rows, horizontal borders). Pages contain up to limit items within the tool payload budget: follow nextOffset until null. Word appearance describes declared header, first body-row band, and primary borders, conditional on headerRow/bandedRows options. Missing properties are inherited, not white or border-free. Document Normal Table, other enabled regions, and direct formatting can override these cues. Resolve themeColor through styles.getTheme: resolve every role through colorSchemeMapping first (text1/text2/background1/background2 use t1/t2/bg1/bg2 keys); unmapped accents use their same-named colorScheme slot. Apply OOXML hex tint/shade modifiers; a neutral accent:null may still use theme colors. Convenience appearance is null. This fixed catalogue does not read or change the document; tables.getStyles lists installed styles.readtables.mergeCellsMerge a range of table cells into one.mutatestables.moveMove a table to a new position in the document.mutatestables.moveColumnMove a column to a new position within the same table. Direct mode only; tables with vertical merges, nested tables, or irregular column coverage are rejected, and tracked (suggesting) mode is not supported yet.mutatestables.moveRowMove a row to a new position within the same table.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 column values, preserving the leading repeating-header prefix unless skipHeaderRows specifies an exact override. Repetition flags and styling remain attached to their rows. Collaborative sessions reject structural table rewrites without mutation.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