如何将输出并排放在闪亮的?

Com*_*vic 4 r shiny

如何并排排列输出?我试过fluidRow列,但它不起作用(第二个表出现在第一个内部).

这是我的应用程序的图像. 在此输入图像描述

和标签代码:

          tabPanel("Wavelet Coefficients", htmlOutput("tmod1"),
                   tableOutput("wsf"), tableOutput("wbf"), htmlOutput("tmod2"),
                   tableOutput("vsf"), tableOutput("vbf")),
Run Code Online (Sandbox Code Playgroud)

先感谢您

Ale*_*hod 8

布局的详细概述如下:RStudio:应用程序布局指南.

基本上你需要的是定义一个行shiny::fluidRow(),你随后使用它划分成列shiny::column().在Bootstrap约定之后,总宽度等于12.

看看你的例子我会尝试将它拆分为7/5,但是由你来校准布局.

您的代码应更改如下:

tabPanel("Wavelet Coefficients", 
  fluidRow(htmlOutput("tmod1")), # Header, I presume ?
  fluidRow(
    column(width = 7, tableOutput("wsf")),
    column(width = 5, tableOutput("wbf"))),
  fluidRow(htmlOutput("tmod2")), # Header #2, I presume ?
    column(width = 7, tableOutput("vsf")),
    column(width = 5, tableOutput("vbf"))
)
Run Code Online (Sandbox Code Playgroud)

`

下面是工作示例中的代码,可以在这里找到:https://github.com/Gnolam/stackoverflow-examples/tree/master/Shiny-2-columns

tabPanel(
  "2 columns",
  fluidRow(
    column(width = 4,
           h2("Column #1"),
           plotOutput("distPlot")),
    column(width = 8,
           h2("Column #2"),
           DT::dataTableOutput('tbl'))
  ))
Run Code Online (Sandbox Code Playgroud)

如果有帮助,请告诉我