Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

Missing lines in wrapped tables #366

Open rubak opened 1 year ago

rubak commented 1 year ago

If a table without rownames (including tibbles) wraps over two parts empty lines are missing in the second part

library(pander)
tab <- data.frame(c("x", "x", "x"), c("x", "", "x"), c("x", "", "x"),
                  c("x", "", "x"), c("x", "", "x"), c("x", "", "x"),
                  c("x", "", "x"), c("x", "", "x"), c("x", "", "x"))
rownames(tab) <- paste("Ingredient", 1:3)
colnames(tab) <- paste("Recipe", 1:9)
pander(tab)
  Recipe 1 Recipe 2 Recipe 3 Recipe 4 Recipe 5
Ingredient 1 x x x x x
Ingredient 2 x
Ingredient 3 x x x x x

Table continues below

  Recipe 6 Recipe 7 Recipe 8 Recipe 9
Ingredient 1 x x x x
Ingredient 2
Ingredient 3 x x x x
rownames(tab) <- NULL
pander(tab)
Recipe 1 Recipe 2 Recipe 3 Recipe 4 Recipe 5 Recipe 6 Recipe 7
x x x x x x x
x
x x x x x x x

Table continues below

Recipe 8 Recipe 9
x x
x x
sessionInfo()
#> R version 4.3.0 (2023-04-21)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.6 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3;  LAPACK version 3.9.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_DK.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_DK.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_DK.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_DK.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: Europe/Copenhagen
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] pander_0.6.6
#> 
#> loaded via a namespace (and not attached):
#>  [1] styler_1.10.1     digest_0.6.31     fastmap_1.1.1     xfun_0.39        
#>  [5] magrittr_2.0.3    glue_1.6.2        R.utils_2.12.2    knitr_1.43       
#>  [9] htmltools_0.5.5   rmarkdown_2.22    lifecycle_1.0.3   cli_3.6.1        
#> [13] R.methodsS3_1.8.2 vctrs_0.6.2       reprex_2.0.2      withr_2.5.0      
#> [17] compiler_4.3.0    R.oo_1.25.0       R.cache_0.16.0    purrr_1.0.1      
#> [21] rstudioapi_0.14   tools_4.3.0       evaluate_0.21     Rcpp_1.0.10      
#> [25] yaml_2.3.7        rlang_1.1.1       fs_1.6.2