Data summaries
Presenting a compact report or scorecard inside a Plotly figure.
Plotly · Class
go.Table creates an interactive Plotly table trace for displaying detailed data in a row-and-column grid. Its body data is supplied in column-major order, with styling available for headers, columns, rows, and cells.
go.Table is a Plotly trace for presenting structured data in a grid. Supply column-oriented vectors through header and cells; styling can be applied at the header, column, row, or cell level.
go.Table(header=dict(...), cells=dict(...))| Name | Type | Description |
|---|---|---|
header | dict | Configuration object containing the table header values and styling. |
cells | dict | Configuration object containing column-oriented body values and styling. |
A Plotly Table trace object.
go.Table when a figure needs a structured, detailed view of data.import plotly.graph_objects as go
fig = go.Figure(data=[go.Table(
header=dict(values=["A Scores", "B Scores"]),
cells=dict(values=[[100, 90, 80, 90], [95, 85, 75, 95]])
)])
fig.show()Creates a Plotly figure containing a table with two columns and four data rows, then displays it.
Presenting a compact report or scorecard inside a Plotly figure.
Displaying tabular values alongside charts in an interactive dashboard.
Applying separate formatting to headings and data regions.
go.Table used for, and how are its values organized?go.Table creates a table trace whose data is arranged as rows and columns. Its cell values use column-major order, so each inner vector represents one column.
Follow-up: How would you place it beside a Cartesian trace? Define a table subplot type and add the table trace there, while keeping Cartesian traces in an xy subplot.
The header configuration supplies header values, while cells supplies the displayed body values. Both can also carry presentation settings such as fill, line, font, and alignment.
Follow-up: How would you style only one part of the table? Apply the relevant styling property at the header, column, row, or cell level supported by the trace.
A table is not positioned with Cartesian axes. Its location in the plotting area is controlled by the trace domain.
Follow-up: What should be checked when combining a table with ordinary plots? Ensure the subplot configuration uses the appropriate table type instead of assuming every trace belongs to an xy subplot.
go.Figurego.Table.headergo.Table.cellstable.domain