【问题标题】:R vertical scroll not workingR垂直滚动不起作用
【发布时间】:2017-02-08 02:09:39
【问题描述】:

我正在尝试垂直滚动,但这不起作用,谁能解释为什么?我还想默认一次显示 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')
```

【问题讨论】:

    标签: dt flexdashboard


    【解决方案1】:

    scrollY 参数不是布尔值。您需要将表格的固定高度指定为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"))
    ```
    

    【讨论】:

      猜你喜欢
      • 2012-06-21
      • 1970-01-01
      • 1970-01-01
      • 2016-12-20
      • 2018-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多