最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to preserve rowcolumn layout in Quarto dashboard tabsets when using explicit headers? - Stack Overflow

programmeradmin2浏览0评论

I'm trying to use row and column layouts within tabset panels but I'm getting unexpected behaviour. In the below example, I'm getting the expected result only in tab 2 (row and column layouts are respected) but not tab 1. I posted this in the quarto-cli discussions and was told it relates to this issue, and that the issue contains everything I need to get a workaround (but my subsequent question was left unanswered). I don't understand how to apply the issue to my own example. I've tried replacing the {.tabset} headings with {.card} headings but to no avail.

---
title: "Cars"
format: dashboard
---
    
## Row {.tabset}

### 1

#### Row {height=20%}

```{r}
print("Row = 20%")
```

#### Row {height=80%}

##### Column {width=50%}

```{r}
print("Column = 50%")
```

```{r}
print("Column = 50%")
```

##### Column {width=50%}

```{r}
print("Column = 50%")
```

### 2

#### Row {height=20%}

```{r}
print("Row = 20%")
```

#### Row {height=80%}

##### Column {width=50%}

```{r}
print("Column = 50%")
```

```{r}
print("Column = 50%")
```

##### Column {width=50%}

```{r}
print("Column = 50%")
```

I'm trying to use row and column layouts within tabset panels but I'm getting unexpected behaviour. In the below example, I'm getting the expected result only in tab 2 (row and column layouts are respected) but not tab 1. I posted this in the quarto-cli discussions and was told it relates to this issue, and that the issue contains everything I need to get a workaround (but my subsequent question was left unanswered). I don't understand how to apply the issue to my own example. I've tried replacing the {.tabset} headings with {.card} headings but to no avail.

---
title: "Cars"
format: dashboard
---
    
## Row {.tabset}

### 1

#### Row {height=20%}

```{r}
print("Row = 20%")
```

#### Row {height=80%}

##### Column {width=50%}

```{r}
print("Column = 50%")
```

```{r}
print("Column = 50%")
```

##### Column {width=50%}

```{r}
print("Column = 50%")
```

### 2

#### Row {height=20%}

```{r}
print("Row = 20%")
```

#### Row {height=80%}

##### Column {width=50%}

```{r}
print("Column = 50%")
```

```{r}
print("Column = 50%")
```

##### Column {width=50%}

```{r}
print("Column = 50%")
```
Share Improve this question edited Mar 31 at 8:40 Jan 9,8506 gold badges20 silver badges33 bronze badges asked Mar 31 at 8:28 WaspWatcherWaspWatcher 898 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I don't see a possibility to do this with nested cards similar to the example in quarto-dev/quarto-cli#11387.

However, you can use .columns and .rows divs for defining the grid layout and then place the content inside some .card.

---
title: "Palmer Penguins"
format: dashboard
---
    
## Row {.tabset}

### 1

:::::: {.rows}

::::: {.card height="20%"}
```{r}
print("Row = 20%")
```
:::::

:::: {.columns}

::: {.rows}
```{r}
print("Column = 50%")
```
```{r}
print("Column = 50%")
```
:::

```{r}
print("Column = 50%")
```

::::

::::::

### 2

{{< lipsum >}}

发布评论

评论列表(0)

  1. 暂无评论