Skip to main content

Summary

Retrieve cell information for a table, optionally filtered by row or column.
  • Operation ID: tables.getCells
  • API member path: editor.doc.tables.getCells(...)
  • Mutates document: no
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a TablesGetCellsOutput with cell information for the requested rows and columns.

Input fields

Variant 1 (target.nodeType=“table”)

FieldTypeRequiredDescription
columnIndexintegerno
rowIndexintegerno
targetTableAddressyesTableAddress
target.kind"block"yesConstant: "block"
target.nodeIdstringyes
target.nodeType"table"yesConstant: "table"

Variant 2 (required: nodeId)

FieldTypeRequiredDescription
columnIndexintegerno
nodeIdstringyes
rowIndexintegerno

Example request

{
  "columnIndex": 1,
  "rowIndex": 1,
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "table"
  }
}

Output fields

FieldTypeRequiredDescription
addressTableAddressyesTableAddress
address.kind"block"yesConstant: "block"
address.nodeIdstringyes
address.nodeType"table"yesConstant: "table"
cellsobject[]yes
nodeIdstringyes

Example response

{
  "address": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "table"
  },
  "cells": [
    {
      "address": {
        "kind": "block",
        "nodeId": "node-def456",
        "nodeType": "tableCell"
      },
      "colspan": 1,
      "columnIndex": 1,
      "nodeId": "node-def456",
      "rowIndex": 1,
      "rowspan": 1
    }
  ],
  "nodeId": "node-def456"
}

Pre-apply throws

  • TARGET_NOT_FOUND

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "oneOf": [
    {
      "required": [
        "target"
      ]
    },
    {
      "required": [
        "nodeId"
      ]
    }
  ],
  "properties": {
    "columnIndex": {
      "minimum": 0,
      "type": "integer"
    },
    "nodeId": {
      "type": "string"
    },
    "rowIndex": {
      "minimum": 0,
      "type": "integer"
    },
    "target": {
      "$ref": "#/$defs/TableAddress"
    }
  },
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "address": {
      "$ref": "#/$defs/TableAddress"
    },
    "cells": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "address": {
            "$ref": "#/$defs/TableCellAddress"
          },
          "colspan": {
            "minimum": 1,
            "type": "integer"
          },
          "columnIndex": {
            "minimum": 0,
            "type": "integer"
          },
          "nodeId": {
            "type": "string"
          },
          "rowIndex": {
            "minimum": 0,
            "type": "integer"
          },
          "rowspan": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "nodeId",
          "address",
          "rowIndex",
          "columnIndex",
          "colspan",
          "rowspan"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "nodeId": {
      "type": "string"
    }
  },
  "required": [
    "nodeId",
    "address",
    "cells"
  ],
  "type": "object"
}