Repository navigation
Great Tables v1.2.0 is the biggest release yet, and it's centered on interactive tables. The new GTI class makes any table something readers can explore. Its i_*() methods add column filters, a query language, exports, column profiles, row details, row grouping, linked tables, and layouts that fit narrow screens. GTI tables work in notebooks, Quarto, and Shiny, Streamlit, Panel, Solara, marimo, and Flask/Django/FastHTML apps, and they can keep their rows in Python, a Polars LazyFrame, DuckDB, or Ibis. opt_interactive() now uses the same engine, so its tables keep everything a GT table has. Outside of interactivity, gtsave() can now write SVG, Word, Excel, PowerPoint, RTF, and Typst files, fmt_nanoplot() draws box plots, fmt_datetime() takes CLDR patterns, and PyArrow support is no longer experimental. This release also brings more than 50 bug fixes, many of them in the PyArrow and Polars backends.
New Features
GTI, interactive tables —GTI(data)(orGTI.from_gt()for a finishedGTtable) makes a table that readers can sort, search, page through, resize, and select rows of. Everything aGTtable has is kept: formatting, styles, stub, row groups, spanners, footnotes, and summary rows. The table is GT's own HTML, brought to life by the bundled<gt-table>component, so it's readable before its script runs and needs no server or internet connection.GTIis experimental. Each feature has its owni_*()method, includingi_sorting(),i_search(),i_pagination(),i_selection(),i_resizing(),i_display()(highlighting, compact rows, no-wrap, monospace), andi_scroll()(a scrolling body with sticky column labels). A wide table keeps its stub pinned as it scrolls sideways, and short pages are padded to a full page's height. (#1059, #1060, #1061, #1062, #1063, #1065, #1066, #1069, #1070, #1073, #1074, #1075)- A control bar for GTI tables — Search, page controls (first, previous, next, and last, with a jump-to readout), an info panel, keyboard shortcuts, a reset button, and tooltips sit next to the table. Drag handles change the rows per page and the scroll height. Pressing
?outlines and names each part of the table, andi_display(parts=True)keeps those names showing (for docs). (#1076, #1077, #1121, #1122, #1164, #1165) - Column filters —
i_cols_filter()gives columns a filter suited to their type: text, a choice of values (facet), a range of numbers or dates, or true/false. (#1078, #1093, #1094) - Views and a query language —
i_view(filter=, sort=, group_by=)sets what a table opens with. Filters show as tokens in the bar, and readers can edit them as text in a query box. The query language hasand,or,not, parentheses,in/not in,contains, regexmatches,is null, strict and inclusive bounds, andtop/bottomclauses. Column labels can be typed in place of column names.i_view_state()keeps the reader's view in the URL or browser storage, and the view has undo and redo. (#1080, #1081, #1082, #1085, #1087, #1096, #1098, #1099, #1100, #1101, #1104, #1171) - Exports —
i_export()lets readers download the rows they're looking at as CSV, TSV, or JSON, copy them as a rich table, or copy Polars, Pandas, or Narwhals code that filters and sorts the data as their view does. (#1083, #1084, #1095) - Column controls —
i_cols_controls()sets sorting, search, and resizing column by column. It can also let readers hide, reorder, and group by columns, keep a column only for querying (display=False), and recolor a column'sdata_color()colors from the rows kept (data_color="recompute").i_cols_pin()pins columns to either side. (#1088, #1089, #1090, #1091, #1092, #1119, #1132) - Layouts for narrow containers —
i_responsive()either stacks rows as cards or drops the least important columns (set withi_cols_priority()) into an expandable row until the table fits. The default,"auto", picks a layout based on the table. On phones, each column has a long-press sheet, and the table has a "Filter & sort" sheet. (#1105, #1112, #1114) - Row details, profiles, and the explorer preset —
i_row_details()lets readers open a row to show more about it, from a function or a column (even a nestedGTtable).i_cols_profile()draws a histogram or top-values plot under each column label, with tooltips and a larger view.GTI(preset="explorer")(andGTI.from_gt(preset="explorer")) sets a table up for looking through data, with filters, profiles, row numbers, dtypes, and missing values tinted byi_inspect(). (#1125, #1126, #1128, #1175, #1187) - Row grouping and linked tables — Readers can group a table's rows by a column, with a heading and count for each group.
i_link()links the tables on a page, so rows selected in one table filter the others. (#1130, #1131) - GTI in notebooks and apps —
i_as_widget()makes the table an anywidget, whose view and selection Python can read and set. In Shiny,render_gt()gives the app inputs for the view, rows, and selection, andupdate_gti()sets them from the server. There's alsost_gti()for Streamlit,GTIPanefor Panel,GTITablefor Solara, andmo_gti()for marimo.great_tables.webhas helpers for pages that Flask, Django, or FastHTML apps make themselves, andGTtables can go straight into Jinja templates (__html__()) and FastHTML components (__ft__()). (#1138, #1139, #1146, #1147, #1152, #1153, #1154, #1182) - Large data in GTI tables — With
i_scale(), a large table keeps its rows in Python (in a widget) or on the Shiny server, and the browser asks for one page at a time.GTI()also takes a Polars LazyFrame, a DuckDB relation, or an Ibis table, and keeps its rows in that backend. AGTISizeWarningis raised when a table may be slow in the browser. (#1124, #1141, #1142, #1143, #1144, #1145) - New
gtsave()formats —gtsave()can now write SVG, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), RTF, and Typst (.typ) files through gridwell. Install it withpip install "great_tables[gridwell]". The gridwell IR behind these formats is available as the experimentalGT.as_gridwell(). (#1167) - Box plots in
fmt_nanoplot()—plot_type="boxplot"draws each row's values as a box and whiskers on a scale shared by all rows, with the statistics shown on hover. Reference lines and areas work with box plots. (#989) - CLDR patterns and flexible styles in
fmt_datetime()— Aformat_str=without%is now a CLDR pattern (e.g.,"EEEE d MMMM y"), formatted for the locale. There are also 24 flexible date styles and 20 flexible time styles ("yMMMd","hm", ...) that follow each locale's word order. These work invals.fmt_datetime()too. (#992, #994) - Indian numbering system —
fmt_number()andfmt_integer()(and theirvalsversions) takesystem="ind"to group digits as in12,34,567. (#1000)
Enhancements
- PyArrow tables are no longer experimental and no longer warn. Every data-layer helper now behaves the same on Pandas, Polars, and PyArrow. (#1140)
- Rendering is faster: formatted values are now written into the body one column at a time instead of one cell at a time. PyArrow render time used to grow with the square of the row count. (#996)
- GTI tables got many fixes and refinements before release, including scrolling, focus and keyboard handling, CSS zoom, pinned columns, search highlights, accessibility of labels and profiles, Panel notebook sync, and rendering speed. (#1097, #1113, #1123, #1148, #1149, #1150, #1162, #1163, #1166, #1172, #1173, #1174, #1177, #1178, #1179, #1180, #1181, #1183, #1184, #1185)
Behavior Changes
opt_interactive()tables are now rendered by GTI instead of reactable. They keep their stub, row groups, spanners, footnotes, summary rows, styles, and fonts, and they need no network access. Everyopt_interactive()option now works, includinguse_highlight=,use_resizers=,selection_mode=,use_filters=, and a"full"page style. (#1115)opt_interactive()now raises for an unknownpagination_type=, andselection_mode=Nonenow turns selection off after an earlier call turned it on. (#1187)- A column name that isn't in the table now raises a
ValueErrornaming it, on every backend. Before, Pandas and PyArrow skipped it silently and Polars raised its own error. (#1186) - A list of booleans in
rows=is now read as a mask (and its length is checked), rather than as the positions 0 and 1. (#1186) fmt_icon()now draws icons from bundled Font Awesome 7.1.0 data, which redraws most of them. The 163 names that come in both solid and regular styles now render the regular style. Use a full name ("fas fa-star") to choose a style. (#1055)- Footnotes now come before source notes in the table footer. (#1133)
- Column labels have 1px more bottom padding by default (
column_labels_padding+ 1px). (#1134) sub_values(fn=)is now called on missing values too, whilevalues=andpattern=still never match them. (#985, #987)- Number-like text now right-aligns on every string dtype (Polars, PyArrow, and Pandas nullable strings), not just Pandas
object. Pandasobjectcolumns without strings are now aligned by what they hold. (#1086, #1107) tab_style_body()anddata_color(fn=)now getNonefor a missing value on every backend. (#1064)- The Pandas datasets now keep text like Namibia's
"NA"country code, as Polars does, instead of reading it as missing. (#1186)
Bug Fixes
- Significant digits are now rounded once, from the stored value. This fixes an
OverflowErrorfor values below about 1e-306 and double rounding inn_sigfig=andfmt_scientific(). The same fix applies tofmt_engineering(),fmt_number_si(), compact numbers, andfmt_bytes(). (#980, #988, #990) - Large integers now keep all their digits in
fmt_number(),fmt_integer(), andfmt_currency(), including when scaled and withn_sigfig=. (#982, #984) - Scientific and engineering notation now stays on one line in HTML. (#983)
- A float
scale_by=now works onDecimalcolumns. (#987) sub_values()now handlespd.NAand skips missing values explicitly, and Pandas columns of arrays or lists now render. (#977, #985)GT.save()with Chrome now works in Colab and Docker containers (as root). (#978)valsfunctions now keep the values they're given, instead of letting Polars' type inference change them (e.g., very large integers, fixed UTC offsets, mixed types). (#993)fmt_datetime(format_str=)now works in tables with a locale. (#991)fmt_duration()withduration_style="colon-sep"now carries larger units into the first field shown and ignoresmax_output_units=, as documented.trim_zero_units=is now checked when the method is called. The<of<1sis now escaped in HTML. (#995, #997, #1186)- The CRC currency symbol's HTML entity is now closed, a zero-width non-joiner was removed from the BGN symbol, and the current ISO 4217 codes BYN, MRU, STN, and VES were added. (#1014, #1015, #1034)
fmt_nanoplot()now supports the"first"and"last"reference keywords, and draws PyArrowfloat64andDecimalcolumns, Pandas numeric columns holdingpd.NA, and NumPy numbers. (#998, #1008, #1009, #1013)- With Polars data,
columns=takes a function andloc.body(rows=)takes a callable. (#1010, #1011) - PyArrow tables now render list and struct columns, accept callables that return a
ChunkedArray, show a NaN in a formatted float column, keep rows with a null group key, and handle reordering with no rows. (#1012, #1016, #1018, #1036, #1037) - PyArrow
large_stringandstring_viewcolumns are now left-aligned. Datetime columns of PyArrow tables and PyArrow-backed Pandas are now right-aligned.string_viewcolumns now work in rendering, grouping, anddata_color(). (#1031, #1039, #1109, #1186) data_color()no longer fails on PyArrow tables when no rows are selected, and it follows the level order of ordered PyArrow dictionary columns. (#1006, #1033)- Nested, Enum, interval, run-end-encoded, dictionary, and union dtypes are no longer treated as numeric. (#1043, #1051, #1108)
- A missing
groupname_colvalue now renders on Pandas as it does on Polars and PyArrow. (#1042) summary_rows()now works for groups with empty, missing, or non-string keys. (#1072)- Missing values in a callable row mask now count as "not selected" on every backend, instead of raising. (#1106)
- Generic missing-value checks no longer import Polars, so
fmt_nanoplot()andvalsfunctions work without it. (#1129) sub_missing()text is no longer merged in as a value bycols_merge_uncert(),cols_merge_n_pct(), orcols_merge_range(). Equalcols_merge_uncert()bounds are now compared using the original values, and asymmetric bounds use a plain minus sign in LaTeX. (#1035, #1038, #1046, #1056)tab_spanner_delim()now gives spanners unique ids when a label repeats. (#1027)- Spanner footnotes are now ordered by column when a spanner's id differs from its label. Footnotes on a missing title, subtitle, or spanner are no longer shown. (#1103, #1136)
- Styles on source notes are now kept when
source_notes_multiline=False. (#1133) - The default CSS's element rules are now scoped to the table, so they no longer change other tables on the page. The footnotes' text color rule is now valid CSS. (#1134, #1135)
Documentation
- The Interactive Tables pages of the User Guide were split into three and rewritten for GTI. They cover scrolling, wide tables, pinned columns, summary rows, notes, exports, selection, narrow layouts, and filter types, and they include a diagram of the parts of a GTI table. (#1151, #1157, #1168, #1170)
GTIand its methods were added to the API reference. (#1156)- The rest of the User Guide was modernized. (#1158)
- Docstring examples now use the
data.pldatasets, and the docs show that a Polars.styletable can become a GTI table. (#1159, #1160) - The README now has an animated demo of a GTI table. (#1161)
- A broken User Guide link on the home page was fixed. (#1117)
Maintenance
- htmltools and faicons are no longer dependencies. (#1054, #1055)
- The data-layer tests now run on every frame and series constructor, and every rendering scenario is checked on every backend, with any differences pinned. This groundwork made the PyArrow promotion possible. (#1001, #1004, #1019, #1029, #1032, #1050, #1052, #1057, #1067, #1071)
- The GTI end-to-end tests run in Chromium, Firefox, and WebKit, and in Jupyter, Quarto, Shiny, marimo, and VS Code, with benchmarks for the runtime. (#1116, #1118)
- Earlier fixes to the reactable renderer that
opt_interactive()used before this release, and the removal of its unused DataTables and jQuery files. (#986, #1041, #1058) - Ruff was upgraded to 0.17.4 with its default lint rules, and CI now uses uv and builds the docs in parallel. A nested
pytest.approx()that pytest 9.2 rejects was flattened. (#1044, #1110, #1111, #1137)