【问题标题】:reduce space between datatables at RMarkdown减少 RMarkdown 数据表之间的空间
【发布时间】:2019-10-08 16:58:04
【问题描述】:

我只是想知道是否有任何方法可以减少 Rmarkdown 工作表中表之间的空间(下面的一个)。我试过做

<div style="width: 100%;margin-top: 1px;margin-bottom: 1px;">
<div style="width: 63%;float: bottom;margin-top: 1px;margin-bottom: 1px;">

```{r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'}
#here the two tables I need to print at the Markdown


But it doesn´t work. Do you have any sugestions? Thanks a lot!



【问题讨论】:

    标签: datatable rstudio markdown r-markdown knitr


    【解决方案1】:

    两个表之间的最小距离是一行 - 否则它们将被合并(如您在我的示例中所见): Example with 1 line distance and without one line distance

    你的md文档的输出格式是什么?

    【讨论】:

    • 您好!我无法合并表格,因为两者都是按列以不同方式自定义的。无论如何,我可以通过在边距顶部添加负值来解决它。结果是这样的:
    • {r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'} #one datatable here
      {r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'} #the otherone here (negative margin-top)
    【解决方案2】:

    我最终可以通过对第二张桌子使用负边距顶部来解决它。

    <div style="width: 100%;margin-top: 50px;margin-bottom: 0px;"> 
    {r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'} 
    #one datatable here 
    </div> 
    
    <div style="width: 66%;float: bottom;margin-top:-19px;margin-bottom: 50px;"> 
    
    {r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'} 
    #the otherone here (negative margin-top) 
    
    </div> 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多