plotly.figure_factory.create_table — 6.6.0 documentation

Function that creates data tables.

>>> text = [['Country', 'Year', 'Population'],
...         ['US', 2000, 282200000],
...         ['Canada', 2000, 27790000],
...         ['US', 2010, 309000000],
...         ['Canada', 2010, 34000000]]
>>> from plotly.figure_factory import create_table
>>> text = [['Country', 'Year', 'Population'],
...         ['US', 2000, 282200000],
...         ['Canada', 2000, 27790000],
...         ['US', 2010, 309000000],
...         ['Canada', 2010, 34000000]]
>>> table = create_table(text,
...                      colorscale=[[0, '#000000'],
...                                  [.5, '#80beff'],
...                                  [1, '#cce5ff']],
...                      font_colors=['#ffffff', '#000000',
...                                 '#000000'])
>>> table.show()
>>> from plotly.figure_factory import create_table
>>> import pandas as pd
>>> df = pd.read_csv('http://www.stat.ubc.ca/~jenny/notOcto/STAT545A/examples/gapminder/data/gapminderDataFiveYear.txt', sep='      ')
>>> df_p = df[0:25]
>>> table_simple = create_table(df_p)
>>> table_simple.show()