如何在Shiny flexdashboard中扩展renderTable宽度

nev*_*int 7 r r-markdown shiny flexdashboard

我有以下自己包含Shiny-Flexdashboard:

---
title: "FOO"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    vertical_layout: scroll
    orientation: rows
    theme:   default

---

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

Rows
-------------------------------------

### Statistical Test Summary
```{r stat_test_table}
mainPanel(

  renderTable( {
      dat <- df <- structure(list(`Sample name` = structure(1:3, .Label = c("Sample1", 
          "Sample2", "Sample3"), class = "factor"), `FDR correction (mean)` = c(5.93070861978308e-15, 
         6.88632524238004e-13, 3.28339498763286e-16), `FDR correction (sd)` = c(2.00046170407461e-14, 
        2.32019633515427e-12, 1.10782095003689e-15), `P-value (mean)` = c(5.55365134900322e-15, 
        6.44757191496266e-13, 3.07475941705412e-16), `P-value (sd)` = c(1.98732517127302e-14, 
        2.30494707691577e-12, 1.10054774779699e-15)), class = c("tbl_df", 
        "tbl", "data.frame"), .Names = c("Sample name", "FDR correction (mean)", 
        "FDR correction (sd)", "P-value (mean)", "P-value (sd)"), row.names = c(NA,  -3L))
  }
  , digits=-2, width = '100%'
  )
)
```
Run Code Online (Sandbox Code Playgroud)

它产生这样的表:

在此输入图像描述

如上所述,我如何扩展列宽?

Big*_*ist 6

有趣.如果你看一下?mainPanel().您将看到宽度默认限制为"8"(12是最大值): mainPanel(..., width = 8)

所以,如果你简单地改变: mainPanel(..., width = 12)它会工作.