flextable (version 0.5.11)

font: Set font

Description

change font of selected rows and columns of a flextable.

Usage

font(x, i = NULL, j = NULL, fontname, part = "body")

Arguments

x

a flextable object

i

rows selection

j

columns selection

fontname

string value, the font name.

part

partname of the table (one of 'all', 'body', 'header', 'footer')

Illustrations

See Also

Other sugar functions for table style: align(), bg(), bold(), color(), empty_blanks(), fontsize(), italic(), line_spacing(), padding(), rotate(), valign()

Examples

Run this code
# 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