OPF
SpecDefinition referenceView source

Table Cell

A scalar, rich-run array, or styled/spanning cell object. Existing scalar and rich forms remain valid.

Metadata

Definition
#/$defs/TableCell
Form
2 alternative forms (oneOf)
Source
spec/schemas/opf.schema.json

Field index

This definition uses the forms or value constraints below.

oneOf 1 · ref:TableCellValue

Referenced TableCellValue · string | number | boolean | null | array<ref:TextRun>

A scalar table value or canonical rich text runs, without cell decoration or geometry.

oneOf 1 · string

Exact constraints for oneOf 1
oneOf 1 schema
{
  "type": "string"
}

oneOf 2 · number

Exact constraints for oneOf 2
oneOf 2 schema
{
  "type": "number"
}

oneOf 3 · boolean

Exact constraints for oneOf 3
oneOf 3 schema
{
  "type": "boolean"
}

oneOf 4 · null

Exact constraints for oneOf 4
oneOf 4 schema
{
  "type": "null"
}

oneOf 5 · array<ref:TextRun>

Exact constraints for oneOf 5
oneOf 5 schema
{
  "type": "array",
  "items": {
    "$ref": "#/$defs/TextRun"
  }
}
Exact constraints for Referenced TableCellValue
Referenced TableCellValue schema
{
  "oneOf": [
    {
      "type": "string"
    },
    {
      "type": "number"
    },
    {
      "type": "boolean"
    },
    {
      "type": "null"
    },
    {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TextRun"
      }
    }
  ],
  "description": "A scalar table value or canonical rich text runs, without cell decoration or geometry."
}
Exact constraints for oneOf 1
oneOf 1 schema
{
  "$ref": "#/$defs/TableCellValue"
}

oneOf 2 · ref:StyledTableCell

Referenced StyledTableCell · object

A cell with explicit visual style or merged geometry. Its position remains its array column index; use null placeholders for every covered grid position.

FieldTypeReq.DefaultDescription
valueref:TableCellValueyes—Editable cell content; styling and spans do not change its scalar type or rich runs.
styleref:TableCellStyle——
colSpaninteger——Number of grid columns covered, starting at this cell. Covered positions must contain null. Default 1.
rowSpaninteger——Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1.
formatref:NumberFormat——Number format. On a body cell it formats that cell's number value (and wins over the column's format); on a header cell (in 'columns') it is the column's format, the same as a DataColumn header. Strings, booleans, null and rich runs display unchanged.

value

typeref:TableCellValuerequiredyesdefault—

Editable cell content; styling and spans do not change its scalar type or rich runs.

style

typeref:TableCellStylerequirednodefault—

style.fill · Named choices (see schema for other values and constraints)
"accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "dark1", "dark2", "light1", "light2", "hyperlink", "followedHyperlink", "primary", "secondary", "accent", "background", "surface", "surfaceAlt", "text", "textSecondary"
style.color · Named choices (see schema for other values and constraints)
"accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "dark1", "dark2", "light1", "light2", "hyperlink", "followedHyperlink", "primary", "secondary", "accent", "background", "surface", "surfaceAlt", "text", "textSecondary"
style.align · Allowed values
"left", "center", "right"
style.verticalAlign · Allowed values
"top", "middle", "bottom"
style.borders.top.color · Named choices (see schema for other values and constraints)
"accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "dark1", "dark2", "light1", "light2", "hyperlink", "followedHyperlink", "primary", "secondary", "accent", "background", "surface", "surfaceAlt", "text", "textSecondary"
style.borders.top.dash · Allowed values
"solid", "dash", "dot"

colSpan

typeintegerrequirednodefault—

Number of grid columns covered, starting at this cell. Covered positions must contain null. Default 1.

rowSpan

typeintegerrequirednodefault—

Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1.

format

typeref:NumberFormatrequirednodefault—

Number format. On a body cell it formats that cell's number value (and wins over the column's format); on a header cell (in 'columns') it is the column's format, the same as a DataColumn header. Strings, booleans, null and rich runs display unchanged.

Exact constraints for Referenced StyledTableCell
Referenced StyledTableCell schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "value"
  ],
  "properties": {
    "value": {
      "$ref": "#/$defs/TableCellValue",
      "description": "Editable cell content; styling and spans do not change its scalar type or rich runs."
    },
    "style": {
      "$ref": "#/$defs/TableCellStyle"
    },
    "colSpan": {
      "type": "integer",
      "minimum": 1,
      "description": "Number of grid columns covered, starting at this cell. Covered positions must contain null. Default 1."
    },
    "rowSpan": {
      "type": "integer",
      "minimum": 1,
      "description": "Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1."
    },
    "format": {
      "$ref": "#/$defs/NumberFormat",
      "description": "Number format. On a body cell it formats that cell's number value (and wins over the column's format); on a header cell (in 'columns') it is the column's format, the same as a DataColumn header. Strings, booleans, null and rich runs display unchanged."
    }
  },
  "description": "A cell with explicit visual style or merged geometry. Its position remains its array column index; use null placeholders for every covered grid position."
}
Exact constraints for oneOf 2
oneOf 2 schema
{
  "$ref": "#/$defs/StyledTableCell"
}
Complete definition constraints
Schema constraints
{
  "oneOf": [
    {
      "$ref": "#/$defs/TableCellValue"
    },
    {
      "$ref": "#/$defs/StyledTableCell"
    }
  ],
  "description": "A scalar, rich-run array, or styled/spanning cell object. Existing scalar and rich forms remain valid."
}