flextable (version 0.5.5)

add_header_lines: Add a label in a header or footer new row.

Description

Add an header or footer new row made of one cell. This is a sugar function to be used when you need to add a title row to a flextable, most of the time it will be used in a context of adding a footnote or adding a title on the top line of the flextable.

Usage

add_header_lines(x, values = character(0), top = TRUE)

add_footer_lines(x, values = character(0), top = FALSE)

Arguments

x

a flextable object

values

a character vector, each element will be added a a new row in the header or footer part.

top

should the row be inserted at the top or the bottom.

See Also

Other headers and footers: add_header_row, add_header, set_header_footer_df

Examples

Run this code
# NOT RUN {
ft <- flextable( head( iris ) )
ft <- add_footer_lines(ft, values = "blah blah")
ft <- add_footer_lines(ft, values = c("blah 1", "blah 2"))
autofit(ft)
ft <- flextable( head( iris ) )
ft <- add_header_lines(ft, values = "blah blah")
ft <- add_header_lines(ft, values = c("blah 1", "blah 2"))
autofit(ft)
# }

Run the code above in your browser using DataCamp Workspace