Autofit and format flextables
flextable_formatted(
tab,
autofit = TRUE,
pg_width = 5,
column_width = NULL,
doc_type = "PDF",
digits = NULL,
font_size = 10,
...
)
a dataframe or flextable object. Must be coercible to a dataframe
logical (T/F). Whether or not to autofit the table.
width (in inches) of the table. Generally 1 inch less than the default word document (8 in.)
named vector, where the column names are assigned to the desired relative width. If specified, set these column widths before fitting to word document
Word, PDF, or HTML. Controls font size and autofit scaling.
numeric. Number of digits to round to. If NULL
, and as_flextable = TRUE
, flextable will round to one digit.
font size of the table.
additional args to be passed to as_flextable()
or flextable()
.
Which function, if any, is called depends on the type of tab
. If tab
is
already a flextable, neither is called. If tab
inherits from
"grouped_data", as_flextable()
is called. Otherwise flextable()
is
called.
a formatted flextable
column_width is specified using the following convention:
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.
Other formatting corrections are done depending on the specified doc_type