Easily Create Presentation-Ready Display Tables
Overview
Build display tables from tabular data with an easy-to-use set of functions. With its progressive approach, we can construct display tables with a cohesive set of table parts. Table values can be formatted using any of the included formatting functions. Footnotes and cell styles can be precisely added through a location targeting system. The way in which 'gt' handles things for you means that you don't often have to worry about the fine details.
New features
- The new
rows_hide()androws_unhide()functions control row visibility, mirroringcols_hide()andcols_unhide(). Hidden rows are excluded from the rendered table but can still be targeted inrowsexpressions, and summary rows are calculated from the visible rows only. (#2127) - Numeric formatting functions (
fmt_number(),fmt_scientific(),fmt_engineering(),fmt_percent(),fmt_currency(), and others) gain adrop_leading_zeroargument. Setting this toTRUEremoves the leading zero from values between -1 and 1 (e.g.,0.75becomes.75), which is useful for displaying correlations, p-values, and other bounded statistics (#2146). (#2155) - Tables can now be saved as PowerPoint files with
gtsave()by using the.pptxfile extension. This is powered by a new OOXML rendering engine that aims to unify Word and PowerPoint output (#97). (@thebioengineer, @romainfrancois, #2158) gt_group()can now combinegt_groupobjects withgt_tblobjects (#2128). (@shannonhaughton, #2129)- Tables with no data rows now display a locale-appropriate message (e.g.,
"Table has no data") in the body area for both HTML and LaTeX output. The message can be customized viatab_options(table.no_data_message = "...")or suppressed by setting it to""(#1881).
Upcoming changes
- gt's internals and documentation now use the base pipe (
|>) throughout. gt still re-exports%>%,dplyr::vars(), andtidyselect::one_of(), but these re-exports will be removed in a future release. Packages relying on them should import them directly from magrittr, dplyr, or tidyselect. (@olivroy, #2150)
Minor improvements and bug fixes
- Fixed LaTeX and RTF output for unformatted
Datecolumns, which now show calendar dates instead of day counts since the Unix epoch (#2177). (@LeonidasZhak, #2180) - Rows in LaTeX output tables no longer overlap when cell text contains line breaks (#2178). (#2179)
- Fixed
cols_merge()with<</>>patterns producing corrupted output when data values contain<or>characters, particularly in LaTeX output (#2153). (#2156)
Show all changes in 1.4.0Hide the rest of the changes in 1.4.0
- Fixed
gt_split()failing on grouped data frames by filtering stale row group metadata after subsetting rows (#2089). (#2157) - Fixed
md()in a column label causing the column to expand to full page width (\linewidth) in LaTeX/PDF output when no explicit column width is set (#2124). (#2162) - Fixed
text_transform()passing HTML-escaped text (e.g.,&) to the user-supplied function instead of the original display text; functions likestringr::str_to_title()now receive and transform plain text as expected (#2033). (#2163) - Fixed
text_replace()failing to match patterns containing LaTeX special characters (e.g., underscores) in LaTeX/PDF output. The same plain-text pattern now works consistently in both HTML and LaTeX (#1592). (#2165) - Styles applied with
tab_style()tocells_column_spanners()are no longer dropped whentab_style()is called beforetab_spanner()(#1438). (#2174) - The
headersattributes on<td>elements in HTML output tables now match theidattributes of their column headings when column names contain spaces, improving accessibility (#2085). (#2173) - The vertical alignment of the row group column (with
row_group_as_column = TRUE) can now be set withtab_style()through body cell styles. (#2176) - Fixed cell misalignment when using
summary_rows(side = "top")withrow_group.as_column = TRUEand no stub column (#1561). (#2175) - Styling can now be applied to summary rows in LaTeX output tables without error (#2117). (@thebioengineer, #2123)
- Fixed multi-column stub rowspans incorrectly crossing row-group boundaries when adjacent groups share the same stub value, which caused group labels to appear in the wrong rows (#2121). (#2161)
- Fixed grand summary rows rendering incorrectly in HTML output tables with a multi-column stub (#2164). (@ChidiebereNjoku, #2167)
- Fixed higher-level column spanners not displaying correctly when a multi-column stub is present (#2170). (@ysaidani, #2171)
- Fixed
cells_stub()incorrectly resolving footnote row indices when a multi-column stub has repeated labels across non-contiguous groups (#2168). (@ysaidani, #2169) - Improved RTF handling of column headers and spanners in tables with a multi-column stub (#2118). (@thebioengineer, #2145)
- Empty strings marked with
md()are now handled correctly in Word output tables (#2119). (@thebioengineer, #2120) - The
keep_with_nextparameter is now applied consistently inas_word()(#2149). (@shannonhaughton, #2151) - Removed usage of
dplyr::case_match(), which is deprecated as of dplyr 1.2.0. (@olivroy, #2125) - Fixed several typos in the documentation. (@jeis4wpi, #2152)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-05-21
- ERROR12 OK, 1 ERROR2026-05-20
- OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
- NOTE11 OK, 3 NOTE2026-04-13
- ERROR10 OK, 3 NOTE, 1 ERROR2026-03-30
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 216 (8 internal)includes a package overview page
- Examples that run
- 100%20 run in a plain check
- Exported functions with examples
- 0%
- Documented parameters
- 96%
- Return-value docs
- 96%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 93%
- Median days to close, 50 most recently updated closed issues
- 274
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
15 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/rstudio/gt on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-14 · The repository has a site deploy workflow
pkgdown site last built 2026-09-14, before release 1.4.0 (2026-10-15)
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2025-11-15Pull request: opened by its own account
Dependencies
Installing gt adds 54 packages (28 with compiled code, 32 MB of source tarballs). Heaviest: bslib 5.6 MB, sass 2.9 MB, rmarkdown 2.1 MB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 41 more dependents and 160 packages that suggest it on CRAN ↗
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.4.0Latest2026-10-15 · current release · diff ↗ ··
added 2 exports
rows_hide, rows_unhide5 hours in CRAN's queue
Listed in CRAN's incoming queue from 2026-10-14 19:53 to 2026-10-15 01:08 UTC, in 3 readings. - RR 4.6.0 released · 2026-04-24
- 1.3.0
- 1.2.02025-12-16 · diff ↗ ·
added 4 exports
fmt_number_si, opt_footnote_order, summary_columns, vec_fmt_number_si - 1.1.0
- RR 4.5.0 released · 2025-04-11
- 1.0.0
- 0.11.1
- 0.11.02024-07-10 · diff ↗ ·
removed 1 export
define_unitsadded 8 exports
as_gtable, fmt_chem, fmt_country, fmt_email, fmt_tf, info_unit_conversions, row_group, unit_conversion - RR 4.4.0 released · 2024-04-24
- 0.10.12024-01-18 · diff ↗
- 0.10.02023-10-07 · diff ↗ ·
added 12 exports
cols_add, cols_nanoplot, cols_units, define_units, extract_body, fmt_icon, fmt_units, from_column, info_flags, info_icons, nanoplot_options, rows_add - RR 4.3.0 released · 2023-04-21
- 0.9.02023-03-31 · diff ↗ ·
added 24 exports
cols_label_with, fmt_auto, fmt_bins, fmt_flag, fmt_image, fmt_index, fmt_spelled_num, fmt_url, grp_add, grp_clone, grp_options, grp_pull, grp_replace, grp_rm, gt_group, gt_split, opt_footnote_spec, opt_interactive, system_fonts, text_case_match, text_case_when, text_replace, vec_fmt_index, vec_fmt_spelled_num - 0.8.02022-11-17 · diff ↗ ·
added 15 exports
cols_align_decimal, extract_cells, fmt_roman, rm_caption, rm_footnotes, rm_header, rm_source_notes, rm_spanners, rm_stubhead, stub, sub_values, tab_caption, tab_info, tab_style_body, vec_fmt_roman - 0.7.02022-08-25 · diff ↗ ·
added 18 exports
as_word, fmt_duration, opt_stylize, tab_stub_indent, vec_fmt_bytes, vec_fmt_currency, vec_fmt_date, vec_fmt_datetime, vec_fmt_duration, vec_fmt_engineering, vec_fmt_fraction, vec_fmt_integer, vec_fmt_markdown, vec_fmt_number, vec_fmt_partsper, vec_fmt_percent, vec_fmt_scientific, vec_fmt_time
Show 12 earlier eventsHide 12 earlier events
- 0.6.02022-05-24 · diff ↗ ·
added 5 exports
fmt_partsper, sub_large_vals, sub_missing, sub_small_vals, sub_zero - 0.5.02022-04-22 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.4.0
- 0.3.1
- RR 4.1.0 released · 2021-05-18
- 0.3.02021-05-12 · diff ↗ ·
removed 1 export
cells_dataadded 8 exports
cells_footnotes, cells_source_notes, cells_stub_grand_summary, cells_stub_summary, cols_merge_n_pct, cols_unhide, fmt_bytes, num_range - 0.2.22020-08-06 · diff ↗ ·
added 6 exports
css, default_fonts, google_font, info_google_fonts, opt_css, opt_table_font - 0.2.12020-05-23 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.2.0.52020-03-31
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2020-03-31
- Total releases
- 20 / 6 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 856 KB / 18 files
- Download size
- 3.3 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("gt")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
The repository also keeps a CITATION.cff.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.