打开使用 R Markdown 生成的“宽”.html 文件(下面的 .rmd 文件代码示例)时,在浏览器中打开该文件时,左侧有大量空白(但不是在 R 视图窗口中) ),这会导致不必要的向右“滚动”。我怎样才能摆脱这个空间?
---
title: "Yucky 'Padding' on Left"
output:
html_document: default
word_document: default
---
```{r echo = FALSE, warning= FALSE, message=FALSE}
library(markdown)
library(kableExtra)
library(DT)
funStuff <- as.data.frame(matrix(1:600,ncol=30))
datatable(funStuff)
``` end
Run Code Online (Sandbox Code Playgroud)
这对我有用,并证明我的 HTML 输出在左侧:
---
title: "Background Info"
date: "November 24, 2019"
output:
html_document:
theme: cerulean
toc: no
---
<style>
.main-container {
max-width: 940px;
margin-left: 0;
margin-right: auto;
}
</style>
Run Code Online (Sandbox Code Playgroud)