Great Tables
Great Tables is a Python library designed to easily generate information-rich, publication-quality display tables from Pandas or Polars DataFrames. It allows for extensive customization of table components like headers, footers, row labels (stubs), spanner labels, and offers various formatting options for cell values, including nanoplots. The current version is 0.21.0, released on March 3, 2026, and it sees active development with regular updates.
Warnings
- gotcha Tables created with Great Tables do not print to the console by default. In a standard Python console, you must explicitly call the `.show()` method on the GT object to open the HTML table in your default web browser.
- breaking The `polars.DataFrame.style` property for styling Polars DataFrames is currently considered unstable and may change in future versions. Directly passing a Polars DataFrame to `GT()` is stable.
- breaking Version 0.15.0 introduced breaking changes related to ensuring unique HTML ID attributes and moving the `css-inline` package to an extra group. While not directly in 0.21.0, this indicates a history of HTML-rendering related breaking changes.
- gotcha The `GT` object is immutable once created. Applying new options or modifications requires re-creating or chaining methods on the `GT` object.
Install
-
pip install great-tables -
conda install -c conda-forge great_tables
Imports
- GT
from great_tables import GT
- data
from great_tables.data import sp500
Quickstart
import pandas as pd
from great_tables import GT
from great_tables.data import sp500
# Filter sp500 using Pandas for a specific date range
start_date = "2010-06-07"
end_date = "2010-06-14"
sp500_mini = sp500[(sp500["date"] >= start_date) & (sp500["date"] <= end_date)]
# Create a display table, add a header, and format columns
gt_table = (
GT(sp500_mini)
.tab_header(title="S&P 500", subtitle=f"{start_date} to {end_date}")
.fmt_currency(columns=["open", "high", "low", "close"])
.fmt_date(columns="date", date_style="wd_m_day_year")
)
# In a notebook environment, `gt_table` will render automatically.
# In a console, use `gt_table.show()` to open in a browser.
# For demonstration purposes, we'll indicate successful creation.
print("Great Table created successfully (output not shown in console).")