
Functions to get or set the font property of huxtable cells.
font(ht)
font(ht) <- value
set_font(ht, row, col, value, byrow = FALSE)
map_font(ht, row, col, fn)
A huxtable.
A character vector of font names.
Set to NA
to reset to the default, which is NA
.
A row specifier. See rowspecs for details.
An optional column specifier.
A mapping function. See mapping-functions for details.
Deprecated. Use by_cols()
instead.
For font
, the font
property.
For set_font
and map_font
, the modified huxtable.
LaTeX and HTML use different font names. If you want to use the same font
names across document formats, set options("huxtable.latex_use_fontspec")
to TRUE
. See huxtable-options.
Other formatting functions: background_color
,
bold
, font_size
,
na_string
, number_format
,
text_color
# NOT RUN {
orig <- font(jams)
font(jams) <- "times"
font(jams)
font(jams) <- orig
jams2 <- set_font(jams,
"times")
font(jams2)
jams3 <- set_font(jams,
2:3, 1, "times")
font(jams3)
jams4 <- map_font(jams,
by_rows(
"times",
"arial")
)
font(jams4)
# }
Run the code above in your browser using DataLab