本文介绍了R垂直滚动不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试获取垂直滚动条,但这不起作用,有人可以解释为什么吗?我还想默认一次显示20行.
I am trying to get a vertical scroll but this isn't working, can anybody explain why? I would also like to default to show 20 rows at once.
谢谢
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
参数不是布尔值.您需要根据数据表文档将表的固定高度指定为 .
The scrollY
parameter isn't a boolean. You need to specify the fixed height of your table as 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"))
```
这篇关于R垂直滚动不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!