【发布时间】:2016-10-07 16:41:36
【问题描述】:
我一直在尝试在 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>
【问题讨论】:
-
pander生成一个降价表,然后pandoc将其转换为 HTML(或所需的任何其他文档格式)作为rmardkdown的一部分。如果您想将表格拉伸到页面/列的整个宽度,我认为这是一个 CSS(使用 HTML 时)问题——markdown 表格定义与它没有太大关系。
标签: r r-markdown pander