rfortherestofus / pagedreport

Templates for {pagedown}
https://pagedreport.rfortherestofus.com
Other
117 stars 19 forks source link

divide in different pages a long table #41

Open oggioniale opened 3 years ago

oggioniale commented 3 years ago

I'm using the pagedreport with much satisfactions. Now I need to insert in the report a longtable, but I didn't find the solution for split it in different pages. This is my code:

---
title: "`r siteTitle`"
subtitle: "eLTER site Information Sheet"
author: "`r siteManager[[1]]$name`"
date: "`r Sys.Date()`"
output: 
  pagedreport::paged_windmill:
    # front_img: "xxxx.jpg"
    # back_img: "xxxx.jpg" 
    logo: "https://pensoft.net/i/projects/elter_logo_PLUS.svg"
    img_to_dark: FALSE
    logo_to_white: FALSE
    toc: FALSE
knit: pagedown::chrome_print
main-color: "#1479BC"
secondary-color: "#408F7A"
---

<style>
  .col2 {
    columns: 2 200px;         /* number of columns and width in pixels*/
    -webkit-columns: 2 200px; /* chrome, safari */
    -moz-columns: 2 200px;    /* firefox */
  }
  .col3 {
    columns: 3 100px;
    -webkit-columns: 3 100px;
    -moz-columns: 3 100px;
  }
</style>

```{r setup, include = FALSE} knitr::opts_chunk$set(echo = TRUE, cache = TRUE)```

# Related resources {-}
``` {r, results = 'asis', message = FALSE, warning = FALSE, echo = FALSE}
parameters <- as_tibble(siteParameter$parameter[[1]]) %>% 
    knitr::kable(
      # cur_data(),
      col.names = c("Parameter name", "link"),
      format = "html",
      longtable = TRUE,
      booktabs = TRUE,
      caption = paste0("List of parameters measured in the site ", siteTitle)
    ) %>%
    kableExtra::kable_styling(
      full_width = TRUE,
      font_size = 14,
      latex_options = c("repeat_header", "striped"),
      repeat_header_text = "\\textit{(Continued on Next Page...)}",
      repeat_header_continued = TRUE,
      repeat_header_method = "append",
      stripe_color = "gray!6"
    )
lapply(parameters, cat)

and this is my output: immagine

any suggestion? Thanks in advance

tvroylandt commented 3 years ago

Hi,

This is not a pagedreport issue but rather a pagedown one. I saw you opened https://github.com/rstudio/pagedown/issues/230

Could https://github.com/rstudio/pagedown/issues/162 solve your problem ?

oggioniale commented 3 years ago

Hi, thank you. Yes I opened the issue in pagedreportbefore to realise that was a pagedownissue.

I read the #162 issue but I didn't find the solution.