flextable (version 0.5.5)

fit_to_width: fit a flextable to a maximum width

Description

decrease font size for each cell incrementally until it fits a given max_width.

Usage

fit_to_width(x, max_width, inc = 1L, max_iter = 20)

Arguments

x

flextable object

max_width

maximum width to fit in inches

inc

the font size decrease for each step

max_iter

maximum iterations

See Also

Other flextable dimensions: autofit, dim.flextable, dim_pretty, flextable_dim, height, width

Examples

Run this code
# NOT RUN {
ft <- qflextable(head(mtcars))
ft <- padding(ft, padding = 0, part = "all")
fit_to_width(ft, max_width = 6)
# }

Run the code above in your browser using DataLab