Skip to main content
Column definition for DataTable.
{
  "type": "object",
  "properties": {
    "key": {
      "description": "Data key to display in this column",
      "type": "string"
    },
    "header": {
      "description": "Column header text",
      "type": "string"
    },
    "sortable": {
      "default": false,
      "description": "Enable sorting for this column",
      "type": "boolean"
    },
    "format": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Cell format: 'number', 'number:2' (decimals), 'currency', 'currency:EUR', 'percent', 'percent:1', 'date', 'date:long'"
    },
    "width": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Column width as CSS value (e.g. '200px', '30%')"
    },
    "minWidth": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Minimum column width as CSS value"
    },
    "maxWidth": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Maximum column width as CSS value"
    },
    "align": {
      "enum": [
        "left",
        "center",
        "right"
      ],
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Cell text alignment \u2014 resolves to cell_class"
    },
    "headerClass": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Tailwind classes for header cells"
    },
    "cellClass": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Tailwind classes for data cells"
    }
  },
  "required": [
    "key",
    "header"
  ]
}