[英]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.