rstudio / pagedown

Paginate the HTML Output of R Markdown with CSS for Print
https://pagedown.rbind.io
Other
892 stars 128 forks source link

Handle table header in multiple pages #250

Closed felipecrp closed 3 years ago

felipecrp commented 3 years ago

This PR resolves #162. It uses a paged.js hook to repeat the table header when a page breaks the table.

The original javascript code was developed by Julien (@julientaq) and improved by Lucas Maciuga and Tafael Caixeta (@tafael) on an issue of the paged.js library (https://gitlab.pagedmedia.org/tools/pagedjs/issues/84).

I just integrated the code into pagedown. I also tested the code with the following snippet.

---
output:
  pagedown::html_paged
---

```{r, echo=FALSE, message=FALSE, results=FALSE}
library(tidyverse)
data(iris)
```

# Table Test

```{r, echo=FALSE}
iris %>% knitr::kable()
```

The result sounds good.

image

felipecrp commented 3 years ago

Hi @cderv ,

I think this PR is ready. Can you review it, please?

Regards,