API Reference
Plotting
Functions to create various types of visualizations, such as bars, dots, and win/loss charts, directly within columns of your existing GT
objects.
gt_plt_bar | Create horizontal bar plots in GT cells. |
gt_plt_bar_pct | Create horizontal bar plots in percentage in GT cells. |
gt_plt_bar_stack | Create stacked horizontal bar plots in GT cells. |
gt_plt_conf_int | Create confidence interval plots in GT cells. |
gt_plt_dot | Create dot plots with thin horizontal bars in GT cells. |
gt_plt_dumbbell | Create dumbbell plots in GT cells. |
gt_plt_winloss | Create win/loss charts in GT cells. |
Colors
Functions to apply color-based formatting, highlight specific columns, or create colorful styles with palettes that are easy on the eye.
gt_color_box | Add PFF-style color boxes to numeric columns in a GT object. |
gt_data_color_by_group | Perform data cell colorization by group. |
gt_highlight_cols | Add color highlighting to one or more specific columns. |
gt_highlight_rows | Add color highlighting to one or more specific rows. |
gt_hulk_col_numeric | Apply a color gradient to numeric columns in a GT object. |
Themes
Predefined themes to style GT
objects, inspired by popular design styles such as ESPN, The Guardian, and Excel.
gt_theme_538 | Applies a FiveThirtyEight-inspired theme to a GT object. |
gt_theme_dark | Applies a dark mode theme to a GT object. |
gt_theme_dot_matrix | Applies a dot-matrix-inspired theme to a GT object. |
gt_theme_espn | Applies an ESPN-inspired theme to a GT object. |
gt_theme_excel | Applies an Excel-inspired theme to a GT object. |
gt_theme_guardian | Applies a Guardian-inspired theme to a GT object. |
gt_theme_nytimes | Applies a New York Times-inspired theme to a GT object. |
gt_theme_pff | Applies a Pro Football Focus (PFF)-inspired theme to a GT object. |
Icons and Images
Functions to enhance GT
objects by adding icons, ratings, or images to cells or headers alike.
add_text_img | Create an HTML element with text and an image, displayed inline. |
fa_icon_repeat | Create repeated FontAwesome SVG icons as HTML. |
gt_fa_rank_change | Create rank change indicators in GT cells using FontAwesome icons. |
gt_fa_rating | Create icon ratings in GT cells using FontAwesome icons. |
img_header | Create an HTML header with an image and a label, suitable for a column label. |
Utilities
Helper functions to extend GT
functionality, including HTML features and formatting tools.
fmt_pct_extra | Convert to percent and show less than 1% as <1% in grey. |
gt_add_divider | Add dividers to specified columns in a GT object. |
gt_duplicate_column | Duplicate a column in a GT object. |
gt_merge_stack | Merge two columns into a stacked format within a GT object. |
gt_two_column_layout | Combine two GT objects into a two-column layout. |
with_hyperlink | Create HTML hyperlinks for use in GT cells. |
with_tooltip | Create HTML text with tooltip functionality for use in GT cells. |