Polotno
Design Format

TableCell

Documentation for the TableCell type in the Polotno design JSON Schema.

Type Information

Base Type: object

Properties

PropertyTypeDescription
idstringUnique identifier for the cell.
type"tablecell"Cell type identifier.
textstringVisible text shown in the cell.
opacitynumberOpacity level (0-1).
rowSpannumberNumber of rows this cell spans.
colSpannumberNumber of columns this cell spans.
mergedIntostringId of the cell this one is merged into, if any.
namestringDisplay name for the cell.
customunknownCustom data attached to the cell.
bordersCellBordersPer-side border overrides for this cell.
fontSizenumberFont size in pixels (inherits from the table when omitted).
fontFamilystringFont family name (inherits from the table when omitted).
fontWeightstringFont weight: 'normal', 'bold', or numeric string (inherits from the table when omitted).
fontStylestringFont style: 'normal' or 'italic' (inherits from the table when omitted).
textDecorationstringText decoration, e.g. underline, line-through (inherits from the table when omitted).
textTransformstringText transform: uppercase, lowercase, capitalize, none (inherits from the table when omitted).
fillstringText color (inherits from the table when omitted).
alignstringHorizontal alignment: left, center, right, justify (inherits from the table when omitted).
verticalAlignstringVertical alignment: top, middle, bottom (inherits from the table when omitted).
lineHeightnumber | stringLine height multiplier or 'auto' (inherits from the table when omitted).
letterSpacingnumberLetter spacing as a fraction of font size (inherits from the table when omitted).
strokeWidthnumberStroke width in pixels (inherits from the table when omitted).
strokestringStroke color (inherits from the table when omitted).
cellBackgroundstringCell background color (inherits from the table when omitted).
cellPaddingnumberCell padding in pixels (inherits from the table when omitted).

JSON Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the cell."
    },
    "type": {
      "default": "tablecell",
      "description": "Cell type identifier.",
      "type": "string",
      "const": "tablecell"
    },
    "text": {
      "default": "",
      "description": "Visible text shown in the cell.",
      "type": "string"
    },
    "opacity": {
      "description": "Opacity level (0-1).",
      "type": "number"
    },
    "rowSpan": {
      "description": "Number of rows this cell spans.",
      "type": "number"
    },
    "colSpan": {
      "description": "Number of columns this cell spans.",
      "type": "number"
    },
    "mergedInto": {
      "description": "Id of the cell this one is merged into, if any.",
      "type": "string"
    },
    "name": {
      "description": "Display name for the cell.",
      "type": "string"
    },
    "custom": {
      "description": "Custom data attached to the cell."
    },
    "borders": {
      "description": "Per-side border overrides for this cell.",
      "type": "object",
      "properties": {
        "top": {
          "description": "Top border override for this cell.",
          "type": "object",
          "properties": {
            "color": {
              "description": "Border color for this side.",
              "type": "string"
            },
            "width": {
              "description": "Border width in pixels for this side.",
              "type": "number"
            },
            "style": {
              "description": "Border style for this side.",
              "type": "string",
              "enum": [
                "solid",
                "dashed",
                "dotted",
                "none"
              ]
            }
          }
        },
        "right": {
          "description": "Right border override for this cell.",
          "type": "object",
          "properties": {
            "color": {
              "description": "Border color for this side.",
              "type": "string"
            },
            "width": {
              "description": "Border width in pixels for this side.",
              "type": "number"
            },
            "style": {
              "description": "Border style for this side.",
              "type": "string",
              "enum": [
                "solid",
                "dashed",
                "dotted",
                "none"
              ]
            }
          }
        },
        "bottom": {
          "description": "Bottom border override for this cell.",
          "type": "object",
          "properties": {
            "color": {
              "description": "Border color for this side.",
              "type": "string"
            },
            "width": {
              "description": "Border width in pixels for this side.",
              "type": "number"
            },
            "style": {
              "description": "Border style for this side.",
              "type": "string",
              "enum": [
                "solid",
                "dashed",
                "dotted",
                "none"
              ]
            }
          }
        },
        "left": {
          "description": "Left border override for this cell.",
          "type": "object",
          "properties": {
            "color": {
              "description": "Border color for this side.",
              "type": "string"
            },
            "width": {
              "description": "Border width in pixels for this side.",
              "type": "number"
            },
            "style": {
              "description": "Border style for this side.",
              "type": "string",
              "enum": [
                "solid",
                "dashed",
                "dotted",
                "none"
              ]
            }
          }
        }
      }
    },
    "fontSize": {
      "description": "Font size in pixels (inherits from the table when omitted).",
      "type": "number"
    },
    "fontFamily": {
      "description": "Font family name (inherits from the table when omitted).",
      "type": "string"
    },
    "fontWeight": {
      "description": "Font weight: 'normal', 'bold', or numeric string (inherits from the table when omitted).",
      "type": "string"
    },
    "fontStyle": {
      "description": "Font style: 'normal' or 'italic' (inherits from the table when omitted).",
      "type": "string"
    },
    "textDecoration": {
      "description": "Text decoration, e.g. underline, line-through (inherits from the table when omitted).",
      "type": "string"
    },
    "textTransform": {
      "description": "Text transform: uppercase, lowercase, capitalize, none (inherits from the table when omitted).",
      "type": "string"
    },
    "fill": {
      "description": "Text color (inherits from the table when omitted).",
      "type": "string"
    },
    "align": {
      "description": "Horizontal alignment: left, center, right, justify (inherits from the table when omitted).",
      "type": "string"
    },
    "verticalAlign": {
      "description": "Vertical alignment: top, middle, bottom (inherits from the table when omitted).",
      "type": "string"
    },
    "lineHeight": {
      "description": "Line height multiplier or 'auto' (inherits from the table when omitted).",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "letterSpacing": {
      "description": "Letter spacing as a fraction of font size (inherits from the table when omitted).",
      "type": "number"
    },
    "strokeWidth": {
      "description": "Stroke width in pixels (inherits from the table when omitted).",
      "type": "number"
    },
    "stroke": {
      "description": "Stroke color (inherits from the table when omitted).",
      "type": "string"
    },
    "cellBackground": {
      "description": "Cell background color (inherits from the table when omitted).",
      "type": "string"
    },
    "cellPadding": {
      "description": "Cell padding in pixels (inherits from the table when omitted).",
      "type": "number"
    }
  },
  "required": [
    "id"
  ]
}

On this page