davidgohel / flextable

table farming
https://ardata-fr.github.io/flextable-book/
562 stars 81 forks source link

Applying `border_inner()` is not working as it should #535

Closed phargarten2 closed 1 year ago

phargarten2 commented 1 year ago

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: image

x %>% border_inner(border = officer::fp_border(width = 1))

Borders Applied: image

Session Info

> xfun::session_info("flextable")
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045), RStudio 2023.3.0.386

Locale:
  LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
  LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

Package version:
  askpass_1.1             base64enc_0.1.3         bslib_0.4.2             cachem_1.0.7            cli_3.6.1               commonmark_1.9.0       
  cpp11_0.4.3             crayon_1.5.2            crul_1.3                curl_5.0.0              data.table_1.14.8       digest_0.6.31          
  ellipsis_0.3.2          evaluate_0.20           fastmap_1.1.1           flextable_0.9.1         fontawesome_0.5.0       fontBitstreamVera_0.1.1
  fontLiberation_0.1.0    fontquiver_0.2.1        fs_1.6.1                gdtools_0.3.3           gfonts_0.2.0            glue_1.6.2             
  graphics_4.2.3          grDevices_4.2.3         grid_4.2.3              highr_0.10              htmltools_0.5.5         httpcode_0.3.0         
  httpuv_1.6.9            jquerylib_0.1.4         jsonlite_1.8.4          knitr_1.42              later_1.3.0             lifecycle_1.0.3        
  magrittr_2.0.3          memoise_2.0.1           methods_4.2.3           mime_0.12               officer_0.6.2           openssl_2.0.6          
  promises_1.2.0.1        R6_2.5.1                ragg_1.2.5              rappdirs_0.3.3          Rcpp_1.0.10             rlang_1.1.0            
  rmarkdown_2.21          sass_0.4.5              shiny_1.7.4             sourcetools_0.1.7.1     stats_4.2.3             stringi_1.7.12         
  stringr_1.5.0           sys_3.4.1               systemfonts_1.0.4       textshaping_0.3.6       tinytex_0.44            tools_4.2.3            
  triebeard_0.4.1         urltools_1.7.3          utils_4.2.3             uuid_1.1.0              vctrs_0.6.1             withr_2.5.0            
  xfun_0.38               xml2_1.3.3              xtable_1.8.4            yaml_2.3.7              zip_2.2.2  

When submitting a new issue:

davidgohel commented 1 year ago

This is a duplicate of #343 and #374

github-actions[bot] commented 1 year ago

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.