Rmarkdown 上的垂直选项卡

问题描述 投票:0回答:1

我创建了一个 html Rmarkdown 文件,其中有一个名为“Sections”的选项卡集,其中包含 3 个子选项卡集。它们都是水平显示的。但我希望这些选项卡集垂直显示在左上角,就像这个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") 
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(kableExtra))

部分 {.tabset .tabset-fade}

总结汽车

summary(cars)

包括情节

plot(pressure)

结构

str(mtcars)



how I set this tabset in top left corner on the html Rmarkdown file ? Any help ? 

(I don't know css at all )
html css r r-markdown
1个回答
0
投票

下面的示例看起来像您链接的示例。

---
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)
```
© www.soinside.com 2019 - 2024. All rights reserved.