
Chris Parmer
November 4, 2026
Tables - A Complete Guide
TL;DR
- A table puts values in rows and columns so readers can look up an exact number and compare it with its neighbors. It beats a chart when people need exact values, or many measures for each row, and loses when the point is a trend or a shape.
- Tables are also known as data tables, data grids and tabular displays, and a table whose cells are colored by value is called a highlight table or heatmap table. They are similar to heatmaps, which drop the numbers and keep the colors, and dot plots and bar charts, which show the same comparison as positions or lengths.
- Good tables round hard, right-align numbers, put units in the header, group and order rows by something meaningful, and use color on one or two columns, not everywhere.
- You can make a static table with Plotly in Python with go.Table, color any cell with cells.fill.color, and put a table next to a chart with make_subplots. For sorting and filtering tens of thousands of rows in an app, use Dash AG Grid, which loaded and filtered all 77,839 US wind turbines in our test.
What is a table?
Tables look like this:

Data: football-data.co.uk, all 380 Premier League results of 2025-26.
How do you read a table? In the example above, notice these things:
- Each row is one club and each column one measure, so you find your club's row and read across: Arsenal won 26, drew 7 and lost 5 of 38 matches, scored 71 and conceded 27, the fewest in the league.
- The rows are ordered by points, then goal difference, then goals scored. Brighton and Brentford both finished on 53 points, and Brighton is above because its goal difference was +6 against +3.
- Color marks the columns that matter. The points column gets darker as points rise, from 20 for Wolves to 85 for Arsenal, 7 ahead of Manchester City, and goal difference is green when positive and red when negative.
- The light red rows are the three relegated clubs, West Ham on 39 points, Burnley on 22 and Wolves on 20.
- The form cells show each club's last five results in order, so Arsenal's five green W cells mean it won its last five matches.
It's often used for charts like these:

Financial statements. ExxonMobil earned $28.8 billion in 2025, about half its 2022 peak of $55.7 billion, while capital expenditures rose every year to $28.4 billion. Data: SEC EDGAR XBRL company facts, Exxon Mobil Corp 10-K filings.

Clinical trial "Table 1". Almost every trial paper opens its results with a table of baseline characteristics by arm. In DAPA-HF, the shares in the two arms of 4,744 patients differed by at most 1.8 percentage points on these rows. Data: ClinicalTrials.gov results for NCT03036124 (McMurray et al. 2019).

Periodic table layouts. By PubChem's discovery dates, 64 of the 118 elements were known by 1869, when Mendeleev published his table, and 28 have been found since 1940. Here the position in the grid is the data. Data: PubChem periodic table, NCBI.
A short history
Tables are older than charts by thousands of years: Plimpton 322, a Babylonian clay tablet from around 1800 BC, holds a table of four columns and fifteen rows. Mendeleev's periodic table of 1869 arranged 63 elements by atomic weight in columns, so that elements with similar properties lined up. The rules most designers still follow come from A. S. C. Ehrenberg's Rudiments of Numeracy (1977): round to two effective digits, add row and column averages, compare figures down columns, order rows and columns by size, use spacing to guide the eye, and use a graph for qualitative points such as whether something went up. Statisticians have argued the other side too: Gelman, Pasarica and Dodhia's Let's Practice What We Preach: Turning Tables into Graphs (2002) went through the tables in an issue of the Journal of the American Statistical Association and redrew them as graphs.
Alternatives to a table
Here's the same ExxonMobil data drawn four ways. Some are better for the question, some worse, some just different:

- Table (better for exact values). An analyst who needs 2023's buybacks reads $17.7 billion in one glance, and the table holds any number of lines in the same space. The 2022 spike is there, but you have to read it.
- Line chart (better for the trend). The 2022 peak in cash flow and net income and the steady rise in capital expenditures show at once, but reading 17.7 off the axis is guesswork.
- Grouped bar chart (worse here). Twenty-five bars make each year's mix comparable but the trend of any one line hard to follow.
- Heatmap with values (works too). Also called a highlight table: it keeps the numbers and adds color, so the 2022 column and the 0.2 for 2021 buybacks stand out. Use one scale only when every row has the same unit.
A common choice is to show both: the Anscombe example below (example 4) puts a table of identical statistics next to the four charts that tell them apart.
How to make a table
With AI
ChatGPT, Claude Code, GitHub Copilot, Cursor and other AI tools are excellent at writing Plotly code. Name Plotly in the prompt, and say how numbers should be formatted and which cells should be colored:
Make a plotly table (go.Table) from premier_league.csv (columns: pos, team, P, W, D, L, GF, GA, GD, Pts, form).- One row per club in the file's order, numbers right-aligned, the club name left-aligned.- Shade the Pts column from white to blue by value, show GD with a sign in green or red,and give the bottom three rows a light red background.- Inter 15 px, white header with a dark rule under it, light gray cell lines.- Fixed width and height so all 20 rows show without scrolling, and a title that states the takeaway.
With Plotly Studio
Plotly Studio is a product for creating data visualizations and Dash apps and for analyzing data with AI, available as a desktop app or embedded in Dash apps. Ask for a table the same way:
Show the S&P 500's monthly returns as a table with one row per year and one column per month, each cell colored from red to blue by the return, and a final column with the year's total.
Make a table in Python or JavaScript
This is the code AI tools write under the hood. In Python, go.Table takes one list per column for the header and the cells, and every style attribute (fill color, font color, alignment) can also be a list per column, which is how conditional formatting works. The Plotly table documentation has more examples:
import pandas as pdimport plotly.graph_objects as godf = pd.read_csv("premier_league.csv") # pos, team, P, W, D, L, GF, GA, GD, Pts# conditional formatting: a light-to-dark blue fill on the points column, red rows for the bottom threeblues = [f"rgba(42,120,214,{0.1 + 0.5 * (p - df.Pts.min()) / (df.Pts.max() - df.Pts.min()):.2f})" for p in df.Pts]row_fill = ["#fdecec" if pos > 17 else "white" for pos in df.pos]cols = ["pos", "team", "P", "W", "D", "L", "GF", "GA", "GD", "Pts"]fig = go.Figure(go.Table(columnwidth=[30, 140] + [40] * 8,header=dict(values=["#", "Club", "P", "W", "D", "L", "GF", "GA", "GD", "Pts"],align=["right", "left"] + ["right"] * 8, font=dict(size=14), fill_color="white"),cells=dict(values=[df[c] for c in cols],align=["right", "left"] + ["right"] * 8, font=dict(size=14), height=30,fill_color=[row_fill] * 9 + [blues]), # one list of colors per column))fig.show()
Cell text takes <b> and <br>, and cells.format takes a d3-format string per column, such as ",.1f" or "+.0%". To put a table next to a chart, use make_subplots(specs=[[{"type": "table"}, {"type": "xy"}]]), as the Treasury example below does.
In JavaScript, plotly.js draws the same thing from a table trace:
<div id="table"></div><script src="https://cdn.plot.ly/plotly-4.1.1.min.js"></script><script>// ExxonMobil, $ billions (SEC EDGAR company facts, 10-K filings)const items = ["Revenues and other income", "Net income", "Capital expenditures"];const y2024 = [349.585, 33.68, 24.306];const y2025 = [332.238, 28.844, 28.358];const change = y2025.map((v, i) => v / y2024[i] - 1);Plotly.newPlot("table", [{type: "table",columnwidth: [220, 80, 80, 100],header: {values: ["$ billions", "2024", "2025", "Change"], align: ["left", "right"],fill: {color: "white"}, line: {color: "black"}},cells: {values: [items, y2024, y2025, change],format: ["", ".1f", ".1f", "+.0%"], // d3-format per columnalign: ["left", "right"], height: 30,fill: {color: ["white", "white", "white",change.map(c => c < 0 ? "#fbe3e3" : "#dcefdc")]} // fill the change column by sign}}], {width: 600, height: 220, margin: {l: 10, r: 10, t: 10, b: 10}});</script>
Make an interactive data table with Dash AG Grid
A go.Table scrolls, but it doesn't sort or filter. For that, put the data in a Dash app with Dash AG Grid, which wraps the AG Grid JavaScript library. Dash's older dash_table.DataTable is deprecated and will be removed in Dash 5.0, and the Dash docs recommend AG Grid instead. This app shows all 77,839 turbines in the US Wind Turbine Database with sorting, a filter under every header, d3 number formatting and a conditional cell style:
import dash_ag_grid as dagimport pandas as pdfrom dash import Dash, htmldf = pd.read_csv("wind_turbines.csv.gz") # project, state, county, year, manufacturer, model, capacity_kw, ...number = {"filter": "agNumberColumnFilter", "type": "rightAligned"}columns = [{"field": "project", "pinned": "left", "minWidth": 270},{"field": "state"}, {"field": "county"}, {"field": "year", **number},{"field": "manufacturer"}, {"field": "model"},{"field": "capacity_kw", "headerName": "Capacity (MW)", **number,"valueFormatter": {"function": "params.value == null ? '' : d3.format('.2f')(params.value / 1000)"},"cellStyle": {"styleConditions": [{"condition": "params.value >= 4000","style": {"backgroundColor": "#dbe8f8"}}]}},{"field": "hub_height_m", "headerName": "Hub height (m)", **number},]app = Dash()app.layout = html.Div([dag.AgGrid(rowData=df.to_dict("records"), columnDefs=columns, style={"height": "620px"},defaultColDef={"sortable": True, "filter": True, "floatingFilter": True, "flex": 1}),])app.run()
The screenshot in example 6 below comes from this app. AG Grid sends the rows to the browser once and draws only the rows in view, so sorting and filtering happen without a callback. For millions of rows, its infinite row model fetches rows from Python as the user scrolls.
Share it
Every Plotly chart has a Share chart button (the cloud icon in its toolbar) that uploads it to Plotly Cloud and gives you a link. Only you can see it until you change its visibility.
For a live app, such as the AG Grid table above, publish it with the Plotly Cloud CLI. Coding agents can run these commands for you:
pip install "dash[cloud]"plotly user loginplotly app publish
If your data has to stay in your own cloud or data center, publish to Dash Enterprise instead.
Dos and don'ts
Most of the work in a published table is formatting the numbers and choosing the order of rows and columns. Here are ExxonMobil's figures both ways.
Don't print raw values in dollars to twelve digits, use the database's field names as row labels, sort the rows alphabetically, center the numbers so their digits don't line up, or use a default serif font:

Do round to one or two decimals with the unit in the section rows, use plain labels in the order of the statement, right-align numbers so the digits line up, group related lines, bold the line that matters and shade one thing (here, each line's highest year):

Checklist
Do
- Round to the precision readers need: two or three significant digits, as Ehrenberg suggested, is usually enough.
- Right-align numbers, left-align text, and use the same number of decimals down a column.
- Put units in the header or section row, not in every cell.
- Order rows by something meaningful (rank, size, the statement's own order) and group related rows under section rows.
- Use color on one or two columns or one rule (highest year, relegated rows, negative values), with a legend or a sentence that explains it.
- Use light lines or none; whitespace separates rows well enough.
Don't
- Use a table when the message is a trend or a shape; draw the chart, and put the table next to it if readers need the numbers too.
- Color every cell on one scale when the rows have different units.
- Put dark text on dark fills; switch to white text above a threshold.
- Show more than about 30 rows in a static table; use Dash AG Grid with sorting and filters instead.
Options to customize
A table in Plotly is a go.Table trace, so these are the options that matter most. The full list is in the table trace reference, and Dash AG Grid's options are in the Dash AG Grid reference.
- header.values, cells.values: one list per column; header.values can hold <b> and <br> for two-line headers.
- cells.fill.color: one color, one list per column, or a list of lists for conditional formatting by cell.
- cells.font.color, cells.font.weight: color per column or per cell, weight per column; use white text on dark fills, or wrap a cell's text in <b> to bold one row.
- cells.align, header.align: "left" for text, "right" for numbers, as a list per column.
- cells.format, cells.prefix, cells.suffix: d3-format strings like ",.1f" or "+.0%", and units such as "$" or " MW".
- columnwidth: relative widths, one per column.
- cells.height, header.height: row heights in pixels; text wraps inside the cell when it's too long.
- cells.line, header.line: border color and width; light gray or white works best.
- columnorder: the display order of the columns, without reordering the data.
- domain or make_subplots(specs=[[{"type": "table"}, ...]]): where the table sits next to charts in the same figure.
- dash_ag_grid.AgGrid with columnDefs (valueFormatter, cellStyle, filter), defaultColDef and dashGridOptions: the interactive data table for sorting, filtering, editing and exporting in a Dash app.
More table examples
Six more tables built from real public data, each with its source, the technique that makes it work and a prompt to rebuild it.
1. A heatmap table of monthly returns

The S&P 500 fell 12.5% in March 2020, its worst month from January 2017 to October 2026, and rose 12.7% in April 2020, its best. The index rose in 79 of 118 months. Data: S&P Dow Jones Indices via FRED (SP500).
Tip: give the year column its own color scale, because a 20% year and a 20% month mean very different things.
Get the data from FRED's SP500 series (S&P Dow Jones Indices, daily close) and shape it into a table ofmonth-end price returns (columns: year, month, ret) plus calendar-year returns (columns: year, ret).Build a plotly go.Table: one row per year, one column per month and a year column, values in % with onedecimal and a sign, cell fill from red through white to blue capped at ±8% for months and ±30% for years,and white text on the darkest cells.
Another way to see it: a heatmap with the values written in the cells (px.imshow(text_auto=".1f")) adds hover and a colorbar, but the year column has to go.

2. Bars and sparklines inside a table

China generated 1,175 TWh of solar electricity in 2025, three times the United States, yet solar was 11.1% of its electricity against 21.8% in Spain. The bars show size and the sparklines show each country's own trend. Data: Our World in Data, from Ember and the Energy Institute.
Tip: draw the whole table on one plain x axis (text as scatter text, bars as shapes, sparklines as scaled lines) so every element lines up with its row.
Get the data from Our World in Data's energy dataset (github.com/owid/energy-data, from Ember and theEnergy Institute), countries only, the ten largest solar generators in 2025 with every year 2015-2025(columns: country, year, solar_twh, solar_share).Build a plotly figure that works as a table: rank, country and TWh as text, a horizontal bar per rowscaled to the largest value, the share of electricity, and a sparkline of 2015-2025 on each row's ownscale with a dot at 2025. Hide the axes.
3. A table next to a chart: the Treasury yield curve

At the end of 2023, one-month Treasury bills yielded 1.72 percentage points more than 10-year notes. By November 3, 2026 they yielded 0.92 points less. The chart shows the curve's shape and the table gives the quotes. Data: Federal Reserve H.15 via FRED.
Tip: color the table's column headers like the lines, so the table doubles as the chart's legend.
Get the data from FRED's daily Treasury par yields (Federal Reserve H.15: DGS1MO, DGS3MO, DGS6MO, DGS1,DGS2, DGS5, DGS10, DGS30), on the last trading day of 2020, 2023 and 2025 and the latest day (columns:date, maturity, years, yield).Build a plotly figure with make_subplots: a go.Table of yields by maturity and date on the left, headertext in each date's line color, and a line chart of the four curves on the right with evenly spacedmaturities and a % axis.
4. Anscombe's quartet: a table next to the charts it hides

Anscombe built four datasets of 11 points whose means, variances, correlation (0.816 or 0.817) and fitted line (y = 3.00 + 0.500x) agree to two decimals, then plotted them to show they look nothing alike. It is the textbook case for drawing the data, not only tabulating it. Data: Anscombe (1973), R dataset anscombe.
Tip: with make_subplots, give the table rowspan=2 so it sits beside a 2x2 grid of charts.
Get the data from Anscombe's quartet (Anscombe 1973, The American Statistician; R dataset anscombe orseaborn-data's anscombe.csv), in long form (columns: dataset, x, y).Build a plotly figure with make_subplots: a go.Table of n, mean and variance of x and y, correlation,and fitted intercept and slope for each dataset, spanning two rows on the left, and four scatter plotswith the same axes and the fitted line on the right.
5. A cross-tab of survival on the Titanic

97% of women and girls in first class survived the Titanic, against 14% of men and boys in second class and 32% of everyone aboard. A cross-tab (contingency table, or pivot table) holds the rate and its counts in one cell. Data: R datasets Titanic (Dawson 1995), from the British Board of Trade inquiry, 1912.
Tip: put the rate first and the counts after it, so readers compare rates and can still check the group size.
Get the data from R's built-in Titanic dataset (Dawson 1995, from the British Board of Trade inquiryreport) as a table of counts (columns: class, sex, age, survived, n).Build a plotly go.Table cross-tab: rows for each class plus all aboard, columns for women and girls, menand boys, and everyone, each cell "rate (survived of aboard)", fill shaded by the rate, totals in bold.
6. 77,839 wind turbines in a Dash AG Grid

Typing TX in the State filter leaves 19,943 of the 77,839 US wind turbines, a quarter of the country's fleet, and sorting by hub height puts a 130 m Goldwind test turbine at the top. Lookups like this are what an interactive data table is for. Data: U.S. Wind Turbine Database (USGS, Lawrence Berkeley National Laboratory, American Clean Power), V9.1.
Tip: set "floatingFilter": True in defaultColDef so every column gets a filter box under its header.
Get the data from the U.S. Wind Turbine Database (USGS, Lawrence Berkeley National Laboratory and theAmerican Clean Power Association, uswtdbCSV.zip), one row per turbine (columns: project, state, county,year, manufacturer, model, capacity_kw, hub_height_m, rotor_m).Build a Dash app with dash_ag_grid.AgGrid: every column sortable with a floating filter, number columnsright-aligned with agNumberColumnFilter, capacity shown in MW with d3.format, cells of 4 MW or moreshaded with cellStyle styleConditions, and the project column pinned left.