| split_columns | R Documentation |
Split a flextable into a list of flextables whose columns fit within a given width (in inches). This is useful for paginating wide tables in Word or PowerPoint output.
split_columns(x, max_width, rep_cols = NULL, unit = "in")
x |
a 'flextable' object, see flextable-package to learn how to create 'flextable' object. |
max_width |
Maximum width for each page (in inches by default). |
rep_cols |
Columns to repeat on every page. Can be a character
vector of column names or an integer vector of column positions.
|
unit |
Unit for |
A list of flextable objects. If no splitting is needed, a single-element list is returned.
Other row and column operations:
add_body(),
add_body_row(),
add_footer(),
add_footer_lines(),
add_footer_row(),
add_header(),
add_header_lines(),
add_header_row(),
delete_columns(),
delete_part(),
delete_rows(),
paginate(),
separate_header(),
set_header_footer_df,
set_header_labels(),
split_rows(),
split_to_pages()
ft <- flextable(head(mtcars))
ft_pages <- split_columns(ft, max_width = 5)
length(ft_pages)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.