Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border problem with merged column in long Word table #176

Open
yxngl opened this issue Jan 6, 2020 · 2 comments
Open

Border problem with merged column in long Word table #176

yxngl opened this issue Jan 6, 2020 · 2 comments
Labels
bug Word related to Word output

Comments

@yxngl
Copy link

yxngl commented Jan 6, 2020

Reporting a bug:

When the column in header and body are both merged vertically and the table spans multiple pages in Word, one part of border (below Species) is missing starting from page 2. HTML output is working, as it is not paginated. And fix_border_issues does not seem to help in this case.

Screen Shot 2020-01-06 at 2 54 40 PM

( The missing border at upper right corner is a separate issue.)
library(flextable)
library(officer)

typology <- data.frame(
  col_keys = c( "Sepal.Length", "Sepal.Width", "Petal.Length",
                "Petal.Width", "Species" ),
  what = c("Sepal", "Sepal", "Petal", "Petal", "Species"),
  measure = c("Length", "Width", "Length", "Width", "Species"),
  stringsAsFactors = FALSE )
ft <- flextable(iris[,c(5,1:4)])
ft <- set_header_df(ft, mapping = typology, key = "col_keys" )
ft <- merge_h(ft, part = "header")

ft <- border_outer(ft,border=fp_border("black","solid",2),part="all")

# commenting out either below will render fine
ft <- merge_v(ft, j=1)
ft <- merge_v(ft, j=1, part = "header")

ft <- fix_border_issues(ft, part = "all")
ft

Session:

R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.15.2

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] officer_0.3.6   flextable_0.5.6

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3        packrat_0.5.0     digest_0.6.23     R6_2.4.1          magrittr_1.5     
 [6] evaluate_0.14     zip_2.0.4         rlang_0.4.2       gdtools_0.2.1     uuid_0.1-2       
[11] data.table_1.12.8 xml2_1.2.2        rmarkdown_2.0     tools_3.5.1       xfun_0.11        
[16] yaml_2.2.0        compiler_3.5.1    systemfonts_0.1.1 base64enc_0.1-3   htmltools_0.4.0  
[21] knitr_1.26  
@davidgohel davidgohel added the bug label Jan 30, 2020
@davidgohel
Copy link
Owner

I am sorry, I really don't know (yet) how to solve that - I spent (too many) times trying to find why this behavior, from what I know everything is ok in the xml structure.

... It will take times but I am not forgetting that issue ;)

@yuliaUU
Copy link

yuliaUU commented Apr 5, 2021

@yxngl may be increasing line spacing will help: %>% line_spacing(space = 0.5, part = "header") ?

@davidgohel davidgohel added the Word related to Word output label Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Word related to Word output
Projects
None yet
Development

No branches or pull requests

3 participants