Skip to content

Review presentation tables and data grids

Run xpd tables <paths> to audit presentation tables and data grids in Python (great-tables GT, pandas Styler, Plotly go.Table, Dash AG Grid) and JavaScript or TypeScript (ag-grid-react, ag-grid-community, Plotly table traces) against 44 tabular presentation principles from the shared presentation catalog (rules/xpd/present.yml).

The table gallery compares Plotly tables before and after applying each table principle.

summary_table.py
import plotly.graph_objects as go
def region_table():
return go.Figure(
go.Table(
header={"values": ["region_name", "TOTAL_REVENUE"]},
cells={"values": [["North", "South"], [12.3456, 8.9]]},
)
)
Terminal window
$ xpd tables summary_table.py --format text
xpd tables: 2 findings (0 wrong, 0 bad, 2 ugly) in 1 file (1 Python, 0 JS/TS), 1 table, 42 checklist items
Note: static-only scan; pass --adapter to run runtime checks (table borders, decimal formatting, alignment, ordering, and grouping).
Libraries: plotly
Tables:
7d3c183b summary_table.py:6 go.Table (table in plotly, route: great_tables.GT, go.Table, or AG Grid (dash_ag_grid.AgGrid / AgGridReact))
...
table-raw-header [ugly]: 2
2e4c8281 summary_table.py:6 `go.Table` header `region_name` looks like a raw identifier or all-caps label. Spell out headers in sentence case with units (Tufte 2001 p. 183).
d110a0e2 summary_table.py:6 `go.Table` header `TOTAL_REVENUE` looks like a raw identifier or all-caps label. Spell out headers in sentence case with units (Tufte 2001 p. 183).
...

Pass --adapter <adapter.py> (or a shell command printing AG Grid JSON specs) to measure table-borders, table-numbers, and table-structure in Rust. Runtime analysis flags vertical rules, zebra striping, default gray go.Table chrome, unformatted decimals, misaligned headers or numeric cells, mixed zeros and nulls, alphabetical row sorting, and flat tables exceeding 12 rows without topical groups.

The adapter's figures() may return a great-tables GT, a pandas Styler, or a string of HTML that holds a <table>. xpd renders a GT with as_raw_html() and a Styler with to_html(), resolves the style of each cell from the markup and its <style> rules, and measures what a reader sees. A rendered HTML table gets five more checks.

Finding kind What the rendered table shows
table-missing-title No title or caption
table-missing-source No source note, and no title, subtitle or caption that names a source
table-flattened-heading-hierarchy Adjacent column headers that repeat a word, such as Loans 2024 and Loans 2025, with no spanner above them
table-total-not-set-apart A subtotal or total row with no heavier rule above it and no bold figures
table-cramped-cells Data cells with less than 8 px of left plus right padding

Start a new presentation table from the great-tables recipe with xpd api xpd/recipe/great-table, which draws a GT in the Warm Editorial theme and passes every check above.

Terminal window
$ xpd tables --questions --format json | jq '{workflow, questions: (.questions | length), findings: (.findings | length)}'
{
"workflow": "tables",
"questions": 44,
"findings": 14
}