Skip to contents

A solid color band carrying condensed uppercase labels, over tight rows, after a television lower-third or a stadium scoreboard.

Usage

gt_theme_scoreboard(
  gt_object,
  accent = "#0E1621",
  density = c("compact", "comfortable", "social"),
  ...
)

Arguments

gt_object

A gt table object to modify.

accent

Character. A hex color for the header band. The label color adapts to it. Defaults to "#0E1621".

density

Character. The type and padding scale. One of "comfortable", "compact", or "social". See Density. Defaults to "compact".

...

Additional arguments passed to gt::tab_options, applied last so they override anything the theme sets.

Value

Returns a modified gt table with the theme applied.

Details

accent sets the band itself, so one argument restyles the whole table to a brand color. The label color is checked against the band and flipped to dark if the accent is pale.

Density

density sets the type and padding scale together. "comfortable" uses a 14px body with roomy rows, "compact" a 12px body with tight rows, and "social" a 17px body with generous rows and a larger title, at the scale gt_save_crop() and gt_social_crop() export at.

Figures

Preview of the scoreboard theme

See also

gt_spotlight() for picking out a row, and gt_fmt_rank() for ordinals.

Examples

library(gt)
northwest <- subset(
  sdv_example_standings, division == "Northwest",
  c(team_name, wins, losses, win_pct:points_against)
)
gt(northwest) |> gt_theme_scoreboard()
team_name wins losses win_pct points_for points_against
Oklahoma City Thunder 64 18 0.780 9760 8846
Denver Nuggets 54 28 0.659 10010 9588
Minnesota Timberwolves 49 33 0.598 9676 9401
Portland Trail Blazers 42 40 0.512 9469 9493
Utah Jazz 22 60 0.268 9642 10333
# a brand color carries the whole table gt(northwest) |> gt_theme_scoreboard(accent = "#0F766E")
team_name wins losses win_pct points_for points_against
Oklahoma City Thunder 64 18 0.780 9760 8846
Denver Nuggets 54 28 0.659 10010 9588
Minnesota Timberwolves 49 33 0.598 9676 9401
Portland Trail Blazers 42 40 0.512 9469 9493
Utah Jazz 22 60 0.268 9642 10333