tables.applyStyle
Toggle 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).
doc.tables.applyStyle(…)Expected result
Returns a TableMutationResult receipt; reports NO_OP if the style and all provided options already match.
Inputs
targetBlockNodeAddressconditionally requiredFields
kind"block"requirednodeType"paragraph" | "heading" | "listItem" | "table" | "tableRow" | "tableCell" | "tableOfContents" | "image" | "sdt"requirednodeIdstringrequiredstoryStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequirednodeIdstringconditionally required2 additional input fields
styleIdstringstyleOptionsobjectFields
headerRowbooleanlastRowbooleantotalRowbooleanfirstColumnbooleanlastColumnbooleanbandedRowsbooleanbandedColumnsbooleanResult
Output fields
true
successtruerequiredtableTableAddressFields
kind"block"requirednodeType"table"requirednodeIdstringrequiredtrackedChangeRefsEntityAddress[]false
successfalserequiredfailureobjectrequiredFields
code"NO_OP" | "INVALID_TARGET" | "TARGET_NOT_FOUND" | "CAPABILITY_UNAVAILABLE"requiredmessagestringrequireddetailsunknownFailures
Pre-apply throws
TARGET_NOT_FOUNDINVALID_TARGETCAPABILITY_UNAVAILABLE
Non-applied receipt codes
NO_OPINVALID_TARGETINVALID_INPUT
Raw schemas
Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.
View raw JSON schemas