
Last chance! 50% off unlimited learning
Sale ends in
change font of selected rows and columns of a flextable.
font(x, i = NULL, j = NULL, fontname, part = "body")
a flextable object
rows selection
columns selection
string value, the font name.
partname of the table (one of 'all', 'body', 'header', 'footer')
Other sugar functions for table style: align
,
bg
, bold
,
color
, empty_blanks
,
fontsize
, italic
,
padding
, rotate
,
valign
# NOT RUN {
require("gdtools")
fontname <- "Times"
if( !font_family_exists(fontname) ){
# if Times is not available, we will use the first available
font_list <- sys_fonts()
fontname <- as.character(font_list$family[1])
}
ft <- flextable(head(iris))
ft <- font(ft, fontname = fontname, part = "header")
# }
Run the code above in your browser using DataLab