如何使用<style type =“ text / css”> rmarkdown更改字体和表格大小

时间:2019-03-05 18:13:24

标签: css html-table r-markdown

我需要一些帮助来设置rmakrdown上的表格单元格大小。我添加了以下内容,但对文档中的表没有任何作用:

  
 

我的桌子太大了。我以为问题是字体大小引起的,所以我进行了更改,但是它对表格大小没有任何作用。

”在此处输入图片描述“

2 个答案:

答案 0 :(得分:0)

<style type="text/css">
  } // this can't be here
td {  /* Table  */
  font-size: 12px;
  border-collapse: collapse;
  border-width:3px
}
</style>

将其更改为此:

<style>
    th, td { 
      font-size: 12px;
      border-collapse: collapse;
      border-width:3px
    }
    </style>

尝试这样。.您的代码中有一个},应该不存在。

答案 1 :(得分:0)

您的body {}样式的默认font-size设置为该大小,因为向TD添加样式会更改TD的样式,但不会更改其他元素。