flextable (version 0.5.1)

style: Set flextable style

Description

Modify flextable text, paragraphs and cells formatting properties.

Usage

style(x, i = NULL, j = NULL, pr_t = NULL, pr_p = NULL,
  pr_c = NULL, part = "body")

Arguments

x

a flextable object

i

rows selection

j

columns selection

pr_t

object(s) of class fp_text

pr_p

object(s) of class fp_par

pr_c

object(s) of class fp_cell

part

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

Examples

Run this code
# NOT RUN {
library(officer)
def_cell <- fp_cell(border = fp_border(color="#00FFFF"))

def_par <- fp_par(text.align = "center")

ft <- flextable(mtcars)

ft <- style( ft, pr_c = def_cell, pr_p = def_par, part = "all")
ft <- style(ft, ~ drat > 3.5, ~ vs + am + gear + carb,
  pr_t = fp_text(color="red", italic = TRUE) )

ft
# }

Run the code above in your browser using DataCamp Workspace