To apply a border of width 1 to all cells in a flextable, I would use border_inner(). I had no problem with the borders using flextable 0.7.2 and officer 0.4.3 in the past.
However, with the new versions, specifying the width fo 1 in officer::fp_border() was ignored in generating the borders as there is a thicker line under the 2nd row (Sepal Length of 4.9). This line should be of width 1, like the others in the body. (In reality, the issue resides in function hline() that is called by border_inner().) I am unsure if a problem exists with a flextable function or with officer::fp_border() .
library(flextable)
library(magrittr)
x <- iris %>% head() %>% flextable::flextable()
x
Original Flextable:
x %>% border_inner(border = officer::fp_border(width = 1))
[x] Provide the results of R command sessionInfo(). It had to be executed after you loaded the packages used by your example. This will let me know what is your version of R and what are the versions of the packages you used in your example.
[x] Make sure you did checked you had the latest version of the package on CRAN (and on github if issue exists with CRAN version).
[x] Make sure you searched in the open and closed issues on the github repository.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
To apply a border of width 1 to all cells in a flextable, I would use
border_inner()
. I had no problem with the borders using flextable 0.7.2 and officer 0.4.3 in the past.However, with the new versions, specifying the width fo 1 in
officer::fp_border()
was ignored in generating the borders as there is a thicker line under the 2nd row (Sepal Length of 4.9). This line should be of width 1, like the others in the body. (In reality, the issue resides in functionhline()
that is called byborder_inner()
.) I am unsure if a problem exists with a flextable function or withofficer::fp_border()
.Original Flextable:
Borders Applied:
Session Info
When submitting a new issue:
[x] Provide the code that is producing the error, it has to be a minimal reproducible example. Stackoverflow is providing good explanations about it: https://stackoverflow.com/help/mcve. You can use package
reprex
to help you: http://reprex.tidyverse.org/. The most popular R stackoverflow question is about the subject: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example.[x] Provide the results of R command
sessionInfo()
. It had to be executed after you loaded the packages used by your example. This will let me know what is your version of R and what are the versions of the packages you used in your example.[x] Make sure you did checked you had the latest version of the package on CRAN (and on github if issue exists with CRAN version).
[x] Make sure you searched in the open and closed issues on the github repository.