control rules of each height for a part of the flextable, this is only for Word and PowerPoint outputs, it will not have any effect when output is HTML or PDF.
hrule(x, i = NULL, rule = "auto", part = "body")
flextable object
rows selection
specify the meaning of the height. Possible values are "atleast" (height should be at least the value specified), "exact" (height should be exactly the value specified), or the default value "auto" (height is determined based on the height of the contents, so the value is ignored).
partname of the table, one of "all", "header", "body", "footer"
Other flextable dimensions:
autofit()
,
dim.flextable()
,
dim_pretty()
,
fit_to_width()
,
flextable_dim()
,
height()
,
ncol_keys()
,
nrow_part()
,
set_table_properties()
,
width()
# NOT RUN {
ft_1 <- flextable(head(iris))
ft_1 <- width(ft_1, width = 1.5)
ft_1 <- height(ft_1, height = 0.75, part = "header")
ft_1 <- hrule(ft_1, rule = "exact", part = "header")
ft_1
ft_2 <- hrule(ft_1, rule = "auto", part = "header")
ft_2
# }
Run the code above in your browser using DataLab