2014-12-19 38 views
5

我在閃亮即頂部,看起來好有一個很好的wellpanel改變一個wellpanel的高度閃亮

screenshot

...但我在所有的額外的灰色空間越來越惱火高於和低於實際控制!我想刪除這個不必要的空間。我行是高了很好的50%,比它需要的,我不知道爲什麼/如何閃亮的大小是這樣。

有誰誰擁有技能的CSS/HTML /閃亮能指出我在正確的方向,關於如何修改呢?迄今爲止我的嘗試都失敗了。

這裏的代碼如下:

shinyUI(fluidPage(


    fluidRow( 
    column(12, 
      wellPanel(    
      tags$div(class = "row", 
         tags$div(class = "span"), 
         tags$div(class = "span1", h1(numericInput(inputId="num", label="ID", value=NaN))), 
         tags$div(class = "span2", h1(sliderInput(inputId="age", "Age Range", min=32, max=99, value=c(32, 99), step=1))), 
         tags$div(class = "span1", h1(radioButtons(inputId="gender", "Gender", c("combined" = 0, "male" = 1, "female" = 2), inline=FALSE))), 
         tags$div(class = "span1", h1(textOutput("text"))) 
      ) 
      ))), 



    fluidRow( 


    column(4, 
      plotOutput("some_plot_not_shown")) 

))) 

感謝遠閱讀本。

回答

8

您可以更改填充:

library(shiny) 
runApp(
    list(ui = fluidPage(   
    wellPanel(    
    tags$div(class = "row", 
      tags$div(class = "span"), 
      tags$div(class = "span1", h1(numericInput(inputId="num", label="ID", value=NaN))), 
      tags$div(class = "span2", h1(sliderInput(inputId="age", "Age Range", min=32, max=99, value=c(32, 99), step=1))), 
      tags$div(class = "span1", h1(radioButtons(inputId="gender", "Gender", c("combined" = 0, "male" = 1, "female" = 2), inline=FALSE))), 
      tags$div(class = "span1", h1(textOutput("text"))) 
    ) 
    , style = "padding: 5px;") 
    , wellPanel(    
    tags$div(class = "row", 
      tags$div(class = "span"), 
      tags$div(class = "span1", h1(numericInput(inputId="num1", label="ID", value=NaN))), 
      tags$div(class = "span2", h1(sliderInput(inputId="age1", "Age Range", min=32, max=99, value=c(32, 99), step=1))), 
      tags$div(class = "span1", h1(radioButtons(inputId="gender1", "Gender", c("combined" = 0, "male" = 1, "female" = 2), inline=FALSE))), 
      tags$div(class = "span1", h1(textOutput("text1"))) 
    ) 
    , style = "padding: 45px;") 
) 
     , server = function(input, output, session){ 

     } 
     ) 
) 

enter image description here

2

我想你想添加columns時使用spans真的是你追求的 - 試試這個:

shinyUI(fluidPage(
    fluidRow(
    column(12, 
     fluidRow(
     wellPanel(
      fluidRow(
      column(3, h1(numericInput(inputId="num", label="ID", value=NaN))), 
      column(3, h1(sliderInput(inputId="age", "Age Range", min=32, max=99, value=c(32, 99), step=1))), 
      column(3, h1(radioButtons(inputId="gender", "Gender", c("combined" = 0, "male" = 1, "female" = 2), inline=FALSE))), 
      column(3, h1(textOutput("text"))) 
     ) 
     ) # End wellPanel 
    ) 
    ) 
), 
    fluidRow(
    column(4, plotOutput("some_plot_not_shown")) 
) 
)) 

Shiny