0

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')

enter image description here

big_cactus
  • 69
  • 1
  • 6
  • Your code does not work, there are at least missing parentheses. Also, why is this question tagged `shiny`? – Jan Aug 30 '23 at 15:09
  • Updated the code - tagged as shiny since this is being ran through a shiny app (and gets more hits than the other two tags). – big_cactus Aug 30 '23 at 15:42

0 Answers0