gt-extras
  • Get Started
  • API Reference
  1. Themes
  2. gt_theme_pff
  • API Reference
  • Plotting
    • gt_plt_bar
    • gt_plt_dot
    • gt_plt_conf_int
  • Colors
    • gt_highlight_cols
    • gt_hulk_col_numeric
    • gt_color_box
  • Themes
    • gt_theme_538
    • gt_theme_espn
    • gt_theme_guardian
    • gt_theme_nytimes
    • gt_theme_excel
    • gt_theme_dot_matrix
    • gt_theme_dark
    • gt_theme_pff
  • Icons and Images
    • fa_icon_repeat
    • gt_fa_rating
  • HTML Helpers
    • gt_hyperlink
    • with_tooltip

On this page

  • Parameters
  • Returns
  • Examples
  1. Themes
  2. gt_theme_pff

gt_theme_pff

gt_theme_pff(gt, divider=None, spanners=None, rank_col=None)

Applies a Pro Football Focus (PFF)-inspired theme to a GT object.

This function styles a GT object with a look inspired by Pro Football Focus tables, supporting custom spanners, dividers, and rank column highlighting.

Parameters

gt : GT

An existing GT object.

divider : str | None = None

Zero or more column names to visually divide with a preceding border.

spanners : list[str] | None = None

Optional list of spanners to style, as referenced by the GT spanner ids.

rank_col : str | None = None

Optional single column name to highlight as a rank column.

Returns

: GT

The themed GT object, allowing for method chaining.

Examples

from great_tables import GT, md
from great_tables.data import gtcars
import gt_extras as gte

gtcars_mini = gtcars[["model", "year", "hp", "trq"]].head(5)

gt = (
    GT(gtcars_mini, rowname_col="model")
    .tab_stubhead(label=md("*Car*"))
    .tab_header(title="Car Collection")
)

gte.gt_theme_pff(gt, rank_col="trq")
Car Collection
Car year hp trq
GT 2017 647.0 550.0
458 Speciale 2015 597.0 398.0
458 Spider 2015 562.0 398.0
458 Italia 2014 562.0 398.0
488 GTB 2016 661.0 561.0
gt_theme_dark
fa_icon_repeat