Skip to contents

Sets a serif body under small letterspaced sans column labels, with hairline rules and no fills anywhere. Row groups are an uppercase label over a rule rather than a colored band.

Usage

gt_theme_broadsheet(
  gt_object,
  accent = "#A6081A",
  density = c("comfortable", "compact", "social"),
  paper = "white",
  ...
)

Arguments

gt_object

A gt table object to modify.

accent

Character. A hex color for the rule above the table and for the row-group labels. Defaults to "#A6081A".

density

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

paper

Character. The table background. Either "white" for a warm off-white, "salmon" for the financial-press pink, or any hex color, in which case the hairline color is left neutral. Defaults to "white".

...

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 recolors the rule above the table and the row-group labels.

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 broadsheet theme

See also

gt_title_header() for a richer header block, and gt_legend_continuous() for explaining a colored column.

Examples

library(gt)

nfc_east <- subset(
  sdv_example_standings, division == "NFC East",
  c(team_name, wins:points_against)
)
gt(nfc_east) |> gt_theme_broadsheet()
team_name wins losses ties win_pct points_for points_against
Philadelphia Eagles 11 6 0 0.647 379 325
Dallas Cowboys 7 9 1 0.441 471 511
Washington Commanders 5 12 0 0.294 356 451
New York Giants 4 13 0 0.235 381 439
# financial-press pink, sized for an image export pacific <- subset( sdv_example_standings, division == "Pacific", c(team_name, wins, losses, win_pct:points_against) ) gt(pacific) |> gt_theme_broadsheet(paper = "salmon", accent = "#0F5257", density = "social")
team_name wins losses win_pct points_for points_against
Los Angeles Lakers 53 29 0.646 9540 9396
Phoenix Suns 45 37 0.549 9232 9112
LA Clippers 42 40 0.512 9329 9236
Golden State Warriors 37 45 0.451 9398 9444
Sacramento Kings 22 60 0.268 9102 9922