[英]How do I eliminate stubborn white space between fluidRows in Shiny?
我在Shiny的UI列中有兩個fluidRows。
我希望最上面的行上面有一點空間,但是我想消除行之間的任何空間 。
我已經嘗試了div
, tags
和各種樣式參數,例如margin: 0px
和padding: 0px ...
,但是我無法獲得相應的間距。
這是一個例子:
ui <- fluidPage( fluidRow( column(1,offset=0, div(style = "font-size: 10px; padding: 14px 0px; margin:0%", fluidRow( sliderInput(inputId = "sizeSlide", label = "Sizing", value = 10, min = 1,max = 20) ) ), div(style = "font-size: 10px; padding: 0px 0px; margin:0px", fluidRow( radioButtons(inputId = "greatORless", label = "DBH Limiter", choices = c(">", "<"), selected = ">") ) ) ) ) )
我得到的是:
我想要的是:
我該怎么做呢??
您可以在margin
上使用負值,在這種情況下,可以使用margin-top:-2em
僅影響頂部邊緣。 我更喜歡使用相對單位,但是您可以使用pixel而不是em
。
library(shiny)
ui <- fluidPage(
fluidRow(
column(1,offset=0,
div(style = "font-size: 10px; padding: 14px 0px; margin:0%",
fluidRow(
sliderInput(inputId = "sizeSlide", label = "Sizing", value = 10, min = 1,max = 20)
)
),
div(style = "font-size: 10px; padding: 0px 0px; margin-top:-2em",
fluidRow(
radioButtons(inputId = "greatORless", label = "DBH Limiter", choices = c(">", "<"), selected = ">")
)
)
)
)
)
shinyApp(ui = ui, server = server)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.