I am using kableExtra
for longtable
with the following code.
library(knitr)
library(kableExtra)
long_dt <- rbind(mtcars, mtcars)
kable(
long_dt,
format = "latex",
longtable = T,
booktabs = T,
caption = "Longtable"
) %>%
add_header_above(c(" ", "Group 1" = 5, "Group 2" = 6)) %>%
kable_styling(latex_options = c("repeat_header"))
The output is
I wonder how to add text (Continued on Next Page ...) at the bottom of the table if it spans to next page.
There is a kableExtra argument for that. I haven't checked but I suppose it wasn't available when the question was first posted.
From the documentation:
The default is (continued...) so for your specific case it would be:
Output: