【发布时间】:2017-11-13 03:58:42
【问题描述】:
我想使用 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")
```
更新:我很笨! “longtable=TRUE”是一个选项。问题是这改变了我的输出顺序并且有点搞砸了。
【问题讨论】:
标签: r r-markdown knitr