2016-09-29 2 views
2

J'essaie d'obtenir un défilement vertical mais cela ne fonctionne pas, quelqu'un peut-il expliquer pourquoi? Je voudrais aussi afficher par défaut 20 lignes à la fois.R rouleau vertical ne fonctionne pas

Merci


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') 
``` 

Répondre

4

Le paramètre scrollY n'est pas un booléen. Vous devez spécifier la hauteur fixe de votre table en tant que 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")) 
```