我创建了一个html Rmarkdown文件,其中有一个名为Sections的选项卡集,其中有三个子选项卡集.它们都水平出现.但我希望这些选项卡垂直显示在左上角,就像这个here一样.

我的Rmarkdown代码如下:

---
title: "test tabsets"
output:
  html_document: 
  theme: null
  highlight: null
  css: styles.css
  toc: true
  toc_float:
    collapsed: true
    smooth_scroll: true
    number_sections: true
date: "2024-04-20"
---



```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
options(knitr.table.format = "html") 
```


```{r, echo=FALSE , include=FALSE}
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(kableExtra))
```

## Sections {.tabset .tabset-fade}

### summary cars
```{r cars}
summary(cars)
```

### Including Plots

```{r pressure, echo=FALSE}
plot(pressure)
```

### structure

```{r mtcars, echo=FALSE}
str(mtcars)
```

如何在html Rmarkdown文件的左上角设置此选项卡集,并且仅在那里,而没有图片中出现的水平部分?

enter image description here

推荐答案

下面的示例看起来与您链接的示例相似.

enter image description here

---
title: "test tabsets"
output:
  html_document: 
    highlight: null
    toc: true
    toc_float: 
      collapsed: false
date: "2024-04-20"
---


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
options(knitr.table.format = "html") 
```


```{r, echo=FALSE , include=FALSE}
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(kableExtra))
```

# Sections  {.tabset .tabset-fade}

### summary cars
```{r cars}
summary(cars)
```

### Including Plots

```{r pressure, echo=FALSE}
plot(pressure)
```

### structure

```{r mtcars, echo=FALSE}
str(mtcars)
```

Html相关问答推荐

我需要主页按钮出现在中间

选中/取消选中带有_hyperscript的多个复选框

R-markdown中的非顺序列表

如何在元素的三条边中间换行边框?

如何收集<;p&>元素下的<;p>;子元素

穿过整个屏幕的旋转线

我正在try 向列表中的图像添加悬停,以放大图像并将div的不透明度设置为1而不是0

文本幻灯片显示动画

如果最后一行的卡数少于其他行,则在使用flex grow使卡在调整大小时拉伸后,flex卡的宽度将被拉伸

(HTML框架标签)点击后目标框架将不再工作

如何将图像放在其内部按钮下方

使用简单的 HTML 设计公司徽标和文本

当作为常规图片输入时,Cloudfront分布式图像可显示,但作为背景图像不显示

在 CSS 中的 div 中获取文本以环绕其他文本?

如何使文本区域自动扩展到最大高度?

如何将 2 种不同的 colored颜色 应用于 css 中的复选框?

Css 左属性问题

在一行中对齐两个不同形式的按钮

为什么将 p 元素的垂直边距设置为 1 px 会出现滚动条?

Bootstrap 5 网格问题,div 向下转义