6.2.6 Tables

There are two methods to create a table in Plotly. One is plotly.graph_objects, the other is plotly.figure_factory

Graph Objects

1. Basic Table

import plotly.graph_objects as go

fig = go.Figure(data=[go.Table(header=dict(values=['Jonas', 'Melo']),
                 cells=dict(values=[[100, 90, 80, 85], [90, 85, 88, 65]]))
                     ])
fig.show()

2. Customized Table

Figure Factory

3. Basic Table

4. Table with LaTeX

The default row height is 30 pixels. We can use \ height_constant to change the height of each row.

5. Customized Table

colorscale for the table :

  • value 0 is the header color

  • .5 is the first table color

  • 1 is the second table color

  • Customize font size

  • Customize height of each row.

  • Address index in the table

Last updated

Was this helpful?