我一直在尝试在 Rmarkdown 文档中使用两列布局,其中包括使用 Pander 呈现的表格。我希望表格呈现为列的宽度,但我尝试过的所有选项似乎都不起作用。这是一个简单的例子。
---
title: "Untitled"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
<div class = "row">
<div class = "col-md-6">
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars, fig}
plot(pressure)
```
</div>
<div class = "col-md-6">
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
library(pander)
pander(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
</div>
</div>