flextable_word: Autofit flextables in word

View source: R/utils.R

flextable_wordR Documentation

Autofit flextables in word

Description

flextable by default will make the tables as wide as possible in word. This function will correct the autofit() feature and make the contents fit.

Usage

flextable_word(tab, pg_width = 7, column_width = NULL)

Arguments

tab

a flextable object

pg_width

width (in inches) of the table. Generally 1 inch less than the default word document (8 in.)

column_width

named vector, where the column names are assigned to the desired relative width. If specified, set these column widths before fitting to word document

Details

column_width is specified using the following convention:

tab %>%
flextable_word(column_width = c("col1" = 2, "col2" = 3))

Value

a formatted flextable


metrumresearchgroup/mrgvalidate documentation built on March 4, 2023, 7:54 a.m.