Skip to contents

Oswald throughout on a near-black ("dark") or white ("light") ground, with a bold title and every column center aligned. Rows are separated by thin black borders and horizontal rules are otherwise hidden.

Usage

gt_theme_tier(
  gt_object,
  style = "dark",
  density = c("comfortable", "compact", "social"),
  ...
)

Arguments

gt_object

A gt table object to modify.

style

Character. The color scheme, "dark" for a near-black ground or "light" for a white ground. Defaults to "dark".

density

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

...

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

Every body row except the last carries a black bottom border, and the last row's border is painted in the ground color so it does not double the edge of the table. Pairs with gt_tiers(), which builds the tier rows themselves.

Density

density scales the theme's type and row padding together. "comfortable" leaves every size as the theme sets it, "compact" scales both down, and "social" scales both up, to the scale gt_save_crop() and gt_social_crop() export at.

Figures

Preview of the tier list theme, dark style

Examples

library(gt)
afc <- subset(
  sdv_example_standings, conference == "AFC" & conference_rank <= 7,
  c(team_name, wins:points_against)
)
gt(afc) |> gt_theme_tier()
team_name wins losses ties win_pct points_for points_against
New England Patriots 14 3 0 0.824 490 320
Buffalo Bills 12 5 0 0.706 481 365
Pittsburgh Steelers 10 7 0 0.588 397 387
Jacksonville Jaguars 13 4 0 0.765 474 336
Houston Texans 12 5 0 0.706 404 295
Denver Broncos 14 3 0 0.824 401 311
Los Angeles Chargers 11 6 0 0.647 368 340
gt(afc) |> gt_theme_tier(style = "light")
team_name wins losses ties win_pct points_for points_against
New England Patriots 14 3 0 0.824 490 320
Buffalo Bills 12 5 0 0.706 481 365
Pittsburgh Steelers 10 7 0 0.588 397 387
Jacksonville Jaguars 13 4 0 0.765 474 336
Houston Texans 12 5 0 0.706 404 295
Denver Broncos 14 3 0 0.824 401 311
Los Angeles Chargers 11 6 0 0.647 368 340