
Last chance! 50% off unlimited learning
Sale ends in
For certain parameters, a length value is required. Examples include the
setting of font sizes (e.g., in cell_text()
) and thicknesses of lines
(e.g., in cell_borders()
). Setting a length in pixels with px()
allows
for an absolute definition of size as opposed to the analogous helper
function pct()
.
px(x)
the numeric value to format as a string (e.g., "12px"
) for
some tab_options()
arguments that can take values as units of
pixels (e.g., table.font.size
).
A character vector with a single value in pixel units.
7-3
Other Helper Functions:
adjust_luminance()
,
cell_borders()
,
cell_fill()
,
cell_text()
,
cells_body()
,
cells_column_labels()
,
cells_column_spanners()
,
cells_grand_summary()
,
cells_row_groups()
,
cells_stubhead()
,
cells_stub()
,
cells_summary()
,
cells_title()
,
currency()
,
default_fonts()
,
escape_latex()
,
google_font()
,
gt_latex_dependencies()
,
html()
,
md()
,
pct()
,
random_id()
# NOT RUN {
# Use `exibble` to create a gt table;
# use the `px()` helper to define the
# font size for the column labels
tab_1 <-
exibble %>%
gt() %>%
tab_style(
style = cell_text(size = px(20)),
locations = cells_column_labels(columns = TRUE)
)
# }
Run the code above in your browser using DataLab