Tables¶
How do I reorder table columns?¶
Reorder the SELECT list in the query. Column order always comes from the query, never from style.columns. See Table Column Config.
How do I hide a table column?¶
Set visible: false on that column under style.columns. Its values stay available to link: templates. See Table Column Config.
How do I rename a table column?¶
Set label: on the column under style.columns, or alias it in SQL. See Table Column Config.
How do I set a column's width or alignment?¶
width: (pixels or a percentage) and align: under style.columns.<column>. style.column_defaults applies to every column at once. See Table Column Config.
How do I format numbers or dates in a table?¶
Set format: on the column: a d3 spec like "$,.0f", a preset like number_full, or a strftime spec like "%B %d, %Y" for dates. See Number Formatting.
How do I paginate a long table?¶
Set style.pagination.page_rows: 25. Use the query's limit: when you want fewer rows fetched, not just fewer shown. See Table Pagination.
How do I make a link in a table cell?¶
Set link: on the chart (every cell) or on a column under style.columns, with {{ column_id }} placeholders. See Linking Between Boards.
How do I add a sparkline inside a table?¶
Set spark: on a column whose cells hold a list of values. See Inline Spark Columns.
How do I make a pivot (cross-tab) table?¶
On a table chart, add rows:, columns:, and values: naming the fields. The query stays long-form. See Pivot.
How do I add a totals row or column?¶
Emit the totals from the query (a literal "Total" value in the pivot field). The renderer never sums for you. See Row and Column Totals.
How do I show the data behind a chart as a table?¶
Add support_table: to the chart to attach a mini data grid, or add a second type: table chart on the same query. See Support Table.