gpt4 book ai didi

dt - R垂直滚动不起作用

转载 作者:行者123 更新时间:2023-12-04 05:29:11 26 4
gpt4 key购买 nike

我正在尝试垂直滚动,但这不起作用,有人可以解释原因吗?我还想默认一次显示 20 行。

谢谢

title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
library(DT)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
datatable(cars ,options = list(c(bPaginate = F, scrollY=T)), filter = 'top')
```

最佳答案

scrollY参数不是 bool 值。您需要将 table 的固定高度指定为 per the datatables documentation .

---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
library(DT)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
DT::datatable(cars, filter = "top",
options = list(pageLength = 20, scrollY = "200px"))
```

关于dt - R垂直滚动不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39775563/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com