Learn R Programming

docorator (version 0.5.2)

scale_gt: Scale gt table contents for document

Description

Scale gt table contents for document

Usage

scale_gt(x, tbl_stub_pct = 0.3)

Value

Table with col_widths settings applied

Arguments

x

table of class gt_tbl

tbl_stub_pct

percent of total width that should be dedicated to stub column(s). If more than 1 stub column then this is the total for both.

Examples

Run this code

gt::gtcars |>
  dplyr::slice_head(n = 10) |>
  dplyr::select(mfr, model, year, msrp, ctry_origin) |>
  gt::gt(
      groupname_col = "ctry_origin",
      rowname_col = "mfr",
      row_group_as_column = TRUE) |>
  scale_gt(tbl_stub_pct = 0.4)

Run the code above in your browser using DataLab