@errantbard为这个问题提供了一个很好的解决方案:
https://stackoverflow.com/a/40650190/645206
. 请访问并投票!
我正在复制我的答案中的解决方案,以展示它如何与您的示例一起工作,并提供解决方案的图像。
为了更好地理解这些
div
标签工作,了解更多关于引导程序库的信息。这里有一个很好的链接:
https://getbootstrap.com/docs/4.1/layout/grid/
---
title: "Foo"
output: html_document
---
```{r setup, include=FALSE}
library(ggplot2)
library(knitr)
library(kableExtra)
```
# Table next to plot
<div class = "row">
<div class = "col-md-6">
```{r echo=FALSE}
kable(head(iris)) %>%
kable_styling(bootstrap_options = "striped", full_width = FALSE, position="left")
```
</div>
<div class = "col-md-6">
```{r echo=FALSE}
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point()
```
</div>
</div>