Columns and formats

Table

Add a table panel when readers need to scan, sort, or compare exact values row by row instead of reading a chart's shape.

What you can do

  • Every column needs a field; label overrides the header text and description renders as a tooltip.
  • headerSource is manual (the default) or warehouse_comment, which fetches the header from the warehouse COMMENT at view time and never persists it.
  • format.type is one of currency, percentage, number, date, duration, compact, or custom, with currency, decimals, prefix, suffix, and scaleBy refining it.
  • align is left, center, or right; sortable and filterable both default to true.
  • defaultSort takes one field and a direction of asc or desc.
  • A width between 40 and 1200 switches the table to fixed layout; wrap (default false) plus maxLines (1-20) wraps a long cell instead of truncating it.
  • frozenColumns (0-20, default 0) keeps that many leading columns in place on horizontal scroll, so identifying columns like segment stay visible.

Applies only to a table panel; columns, defaultSort, and the rest of TableSpec have no equivalent on a chart:* panel.

Spec

View spec
{
  "id": "rev-by-segment-table",
  "type": "table",
  "title": "Revenue by segment",
  "data": {
    "rows": [
      {
        "segment": "Enterprise",
        "revenue": 1050000,
        "mom": 18
      },
      {
        "segment": "Pro",
        "revenue": 735000,
        "mom": 9
      },
      {
        "segment": "Team",
        "revenue": 580000,
        "mom": 4
      },
      {
        "segment": "Starter",
        "revenue": 180000,
        "mom": -6
      }
    ]
  },
  "spec": {
    "columns": [
      {
        "field": "segment",
        "label": "Segment"
      },
      {
        "field": "revenue",
        "format": {
          "type": "currency",
          "currency": "USD",
          "compact": true
        },
        "align": "right"
      },
      {
        "field": "mom",
        "label": "MoM",
        "format": {
          "type": "percentage"
        },
        "align": "right"
      }
    ],
    "defaultSort": {
      "field": "revenue",
      "direction": "desc"
    },
    "frozenColumns": 1
  }
}

defaultSort sorts the table by revenue descending on load; every column keeps sortable and filterable at their true default unless set otherwise.

Try it live

Open the rich-tables template in the Builder

Open the rich-tables template, page p1-presentation, panel p1-reps for a 9-column table with panel- and column-level conditionalFormat, a colorScale column, and a sourceNote.

Build it in dvt

Every table capability on this site is a few lines of the same declarative JSON spec. Read the full spec format, or connect an AI agent to your warehouse and build one live in the quickstart.

Follow the build

dvt is in founding research. Leave your email and we'll reach out when there's something to see — no newsletters, no noise.

No spam. We use this to reach out directly, nothing else.