我想使用kable()生成一个跨越多个页面的表.我知道这可以使用带有"longtable"选项的xtable(),但是我需要kable()来实现其他功能.
有任何想法吗?
```{r cars, echo=TRUE, results='asis', warning=FALSE, message=FALSE}
library(knitr)
library(kableExtra)
# OUTPUT 1, fits on one page
output = rbind(mtcars[, 1:5])
kable(output, booktabs = T, format="latex", caption = "Small Output")
# OUTPUT 2, will not fit on one page
output = rbind(mtcars[, 1:5], mtcars[, 1:5])
kable(output, booktabs = T, format="latex", caption = "Large Output")
```
Run Code Online (Sandbox Code Playgroud)
更新:我很蠢!"longtable = TRUE"是一种选择.问题是,这改变了我的输出顺序,有点混乱.