将文件导出到 HTML 时,.Rmd 文件中的表格未正确显示
The tables in the .Rmd file are not displayed properly when exporting the file to HTML
我有一个 .Rmd 文件,我想将它导出到 HTML 文件。
但是 table 看起来不对。在 Rstudio 中,table 看起来不错:
但是当我将其导出为HTML(或PDF、Word,点击'Knit')时,table显示不正确:
可能你在找kable
,可以输出mdtable,设置results
选项为asis
。
```{r, results='asis'}
efficient <- mtcars[mtcars$mpg > 23,]
knitr::kable(efficient)
```
我有一个 .Rmd 文件,我想将它导出到 HTML 文件。 但是 table 看起来不对。在 Rstudio 中,table 看起来不错:
但是当我将其导出为HTML(或PDF、Word,点击'Knit')时,table显示不正确:
可能你在找kable
,可以输出mdtable,设置results
选项为asis
。
```{r, results='asis'}
efficient <- mtcars[mtcars$mpg > 23,]
knitr::kable(efficient)
```