我有一个 Flexdasboard,其中一个页面包含 1 个绘图,然后在其下面有一个表格。该表当前已被压缩,因此虽然它显示 25 行,但它们都在滚动选项中,因此您一次只能查看其中 2 行。我怎样才能改变这个?
我目前正在使用以下代码进行编码:
---
title: "Plots and tables"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
---
{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
library(dplyr)
library(tidyverse)
library(data.table)
library(plotly)
library(htmlwidgets)
library(DT)
Page 1 {style="position:relative;"}
================================
{r fig.width=14, fig.height=10}
plotlyp1 <- ggplotly(p1)
plotlyp1
Row {style="height:100pc;"}
--------------------------------------------------------
### {data-height=10000}
{r}
DT::datatable(one.data_bp,
rownames = FALSE, options = list(pageLength = 25, lengthMenu = c(5, 10, 15, 20)), filter = 'top', height=10000
)
我已经删除了后面的勾号,因此所有内容都可以作为代码可见。输出的表格如下所示:
因此,这有 25 行,就像我编码的那样,但它们是压缩的,需要滚动,一次只有 1 或 2 行立即可见,如何更改表格的高度,以便至少 5/25 的行可见?
编辑:我已经从技术上解决了这个问题,并通过更改来增加可见的行数Row
设置为:
Row {.tabset .tabset-fade}
--------------------------------------------------------
幸运的是,我不介意表格看起来像在选项卡中,但我觉得这不是最好或最直接的解决方案,我能做些什么吗?