Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fix_border_issues

fix border issues when cell are merged


Description

When cells are merged, the rendered borders will be those of the first cell. If a column is made of three merged cells, the bottom border that will be seen will be the bottom border of the first cell in the column. From a user point of view, this is wrong, the bottom should be the one defined for cell 3. This function modify the border values to avoid that effect.

Usage

fix_border_issues(x, part = "all")

Arguments

x

flextable object

part

partname of the table (one of 'all', 'body', 'header', 'footer')

Examples

library(officer)
dat <- data.frame(a = 1:5, b = 6:10)
ft <- flextable(dat)
  ft <- theme_box(ft)
  ft <- merge_at(ft, i = 4:5, j = 1, part = "body")
  ft <- hline(ft, i = 5, part = "body",
        border = fp_border(color = "red", width = 5) )
print(ft)
ft <- fix_border_issues(ft)
print(ft)

flextable

Functions for Tabular Reporting

v0.6.10
GPL-3
Authors
David Gohel [aut, cre], Clementine Jager [ctb], Quentin Fazilleau [ctb], Maxim Nazarov [ctb] (rmarkdown for docx output), Titouan Robert [ctb], Michael Barrowman [ctb] (inline footnotes), Atsushi Yasumoto [ctb] (support for bookdown cross reference), Paul Julian [ctb] (support for gam objects)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.