【问题标题】:Rshiny: Reduce bottom padding shiny dashboard boxR Shiny:减少底部填充闪亮仪表板框
【发布时间】:2017-09-27 02:35:41
【问题描述】:

附件是shiny::selectInput内的shinydashboard::box,下面是Rshiny中的代码:

box(selectInput(inputId = "test", label = "Normalization", choices = 'RSEM: FPKM'), width = 3, background = 'navy') 

如何更改框填充以减少底部的海军蓝色部分?

我尝试使用 css 增加它:

.box {
  padding-bottom: 50%;
}

它把底部增加到这个:

但是当我尝试减少它时,它并没有改变:

.box {
  padding-bottom: 1%;
}

【问题讨论】:

  • 改用.form-group {margin-bottom: 0px;}
  • @HubertL 这不起作用

标签: css r shiny shinydashboard


【解决方案1】:

form-groupselectize-control 都有可以删除的底部边距。如果想彻底去掉box padding,也可以去掉box-body的底部padding。

这是一个例子:

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody( tags$head(tags$style(HTML('
      .form-group, .selectize-control {
           margin-bottom: 0px;
      }
      .box-body {
          padding-bottom: 0px;
      }'))),
      box(selectInput(inputId = "test", label = "Normalization", choices = 'RSEM: FPKM'), width = 3, background = 'navy') )
)

server <- shinyServer(function(input, output) {
})

shinyApp(ui,server)

【讨论】:

    猜你喜欢
    • 2016-11-11
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 2021-09-05
    • 1970-01-01
    • 2018-05-30
    相关资源
    最近更新 更多