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

See also

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

Examples

library(gt)

gt(head(mtcars[c("mpg", "hp", "wt")], 8)) %>% gt_theme_broadsheet()
mpg hp wt
21.0 110 2.620
21.0 110 2.875
22.8 93 2.320
21.4 110 3.215
18.7 175 3.440
18.1 105 3.460
14.3 245 3.570
24.4 62 3.190
# financial-press pink, sized for an image export gt(head(airquality, 8)) %>% gt_theme_broadsheet(paper = "salmon", accent = "#0F5257", density = "social")
Ozone Solar.R Wind Temp Month Day
41 190 7.4 67 5 1
36 118 8.0 72 5 2
12 149 12.6 74 5 3
18 313 11.5 62 5 4
NA NA 14.3 56 5 5
28 NA 14.9 66 5 6
23 299 8.6 65 5 7
19 99 13.8 59 5 8