【发布时间】:2021-02-06 20:55:06
【问题描述】:
我在 R markdown 文件中使用来自 bookdown 包 tutorial 的以下代码:
```{r}
d1 <- head(cars, 3)
d2 <- head(mtcars[, 1:3], 5)
knitr::kable(
list(d1, d2),
caption = 'Two tables placed side by side.',
booktabs = TRUE, valign = 't'
)
```
与书不同,代码返回的结果在两个表之间没有空格,就像这样。
在一些问题中,我看到了带有cat() 函数和一些html 注入的解决方案。
(另外我们需要设置选项results = 'asis')
我想知道有没有更优雅和简单的方法来在表格之间设置一些空间并同时保留默认的 html 格式?
【问题讨论】:
标签: css r r-markdown knitr bookdown