Currently trying to generate tables in a Word document that take the entire width of the page (see current output below). I've gone between ending each table's statement with functions like flextable::autofit()
or flextable::fit_to_width()
but I cannot get the output to take up the entire width.
Does anyone know how to resolve this?
library(flextable)
library(magrittr)
df <- data.frame(
col1 = c('Value A', 'Value B'),
col2 = c('Value a', 'Value b'),
col3 = c('', ''),
col4 = c('', ''),
col5 = c('', '')
)
columns <- as_paragraph(as_chunk(paste('Column', 1:5)))
flextable(df) %>%
theme_vanilla() %>%
bg(i=1, bg='lightgrey', part='header')