Skip to content

Border problem with merged column in long Word table #176

Description

@yxngl

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  

Metadata

Metadata

Assignees

No one assigned

    Labels

    Wordrelated to Word outputbug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions