我希望使用rmarkdown、knitr和pander在PDF文档中创建一个表。该表应与下表1几乎相同,但星号应为子弹。这完全有可能只使用上面列出的R库吗?

下面是生成PDF文档的代码(以及上表):
---
title: "xxx"
author: "xxx"
date: "xxx"
output:
word_document: default
pdf_document:
fig_height: 4
fig_width: 10
highlight: tango
geometry: margin=3cm
---
```{r global_options, include=FALSE, echo=FALSE}需要(针织品)
opts_chunk$set(fig.width=8,fig.height=4,fig.path='figs/',dpi=500,
echo=FALSE, warning=FALSE, message=FALSE, results='hide')```{r pandoc_options, include=FALSE, echo=FALSE}要求(拉皮条)
panderOptions(“数字”,3)
panderOptions(“圆形”,3)
panderOptions(‘mem.trailing.zeros’,真)
panderOptions(‘main.line.disks’,TRUE)
```{r concepts, echo=FALSE}mytable =data.frame(概念=c(“解码”,"XXX"),
Description = c(" \\\n \\\n * Founded in 2011 \\\n * * Offers workshops to take people from zero skills and knowledge in programming through to coding a multi-platform app using HTML, CSS and Javascript in a single day \\\n * * Rave reviews", "XXX"), Website = c("http://decoded.com/uk/","XXX"))``` {r concepts_descriptions, results = 'asis'}pandoc.table(mytable,style = "multiline",justify = "left",标题=“概念和描述”)
编辑 @Roman为此感谢-然而,如果我只是替换,我得到以下不那么漂亮的表格(“周期”子弹,格式不佳).现在对我来说最重要的是列表的格式。谢谢!

发布于 2015-06-23 21:15:05
默认的multiline样式表不支持单元格内的任意块元素,但grid表支持。所以这是可能的,只要确保:
grid样式left对齐keep.line.break快速演示:
mytable = data.frame(
Concept = c("Decoded", "XXX"),
Description = c("* Founded in 2011\ \n* Offers workshops to take people from zero skills and knowledge in programming through to coding a multi-platform app using HTML, CSS and Javascript in a single day", "XXX"),
Website = c("http://decoded.com/uk/","XXX"))
pander::pander(mytable, keep.line.breaks = TRUE, style = 'grid', justify = 'left')通过pandoc生成格式良好的HTML列表。
<table>
<colgroup>
<col width="13%" />
<col width="43%" />
<col width="30%" />
</colgroup>
<thead>
<tr class="header">
<th align="left">Concept</th>
<th align="left">Description</th>
<th align="left">Website</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Decoded</td>
<td align="left">* Founded in 2011 * Offers workshops to take people from zero skills and knowledge in programming through to coding a multi-platform app using HTML, CSS and Javascript in a single day</td>
<td align="left">http://decoded.com/uk/</td>
</tr>
<tr class="even">
<td align="left">XXX</td>
<td align="left">XXX</td>
<td align="left">XXX</td>
</tr>
</tbody>
</table>但也可以使用PDF格式:

https://stackoverflow.com/questions/31011265
复制相似问题