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()
,
line_spacing()
,
padding()
,
rotate()
,
valign()
# NOT RUN {
require("gdtools")
fontname <- "Brush Script MT"
if( font_family_exists(fontname) ){
ft_1 <- flextable(head(iris))
ft_2 <- font(ft_1, fontname = fontname, part = "header")
ft_2 <- font(ft_2, fontname = fontname, j = 5)
ft_2
}
# }
Run the code above in your browser using DataLab