font | R Documentation |
Set the font for cell text
font(ht)
font(ht) <- value
set_font(ht, row, col, value )
map_font(ht, row, col, fn)
ht |
A huxtable. |
row |
A row specifier. See rowspecs for details. |
col |
An optional column specifier. |
fn |
A mapping function. See mapping-functions for details. |
value |
A character vector or matrix. Set to |
To find out what fonts are on your system, systemfonts::match_font()
is useful.
For HTML, you can use comma-separated lists of font names like
"Times New Roman, Times, Serif"
. This is not portable, though.
LaTeX and HTML use different font names. To use the same font
names across document formats, see options("huxtable.latex_use_fontspec")
in huxtable-options.
font()
returns the font
property.
set_font()
returns the modified huxtable.
Other formatting functions:
background_color()
,
bold()
,
font_size()
,
na_string()
,
number_format()
,
text_color()
font(jams) <- "times"
font(jams)
jams2 <- set_font(jams,
"arial")
font(jams2)
jams3 <- set_font(jams,
2:3, 1, "arial")
font(jams3)
jams4 <- map_font(jams,
by_rows(
"arial",
"times")
)
font(jams4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.