r闪亮框格式内联标签和项目

时间:2020-06-24 20:27:07

标签: css r shiny format inline

我正在使用tags $ style在r Shiny(来自stackoverflow的代码)中内联格式化。现在我想问一下,如何改进或调整框内的格式?

我的代码:

     ## app.R ##
library(shinydashboard)
ui <- dashboardPage(
      dashboardHeader(title = "Basic dashboard"),
      dashboardSidebar(),
      dashboardBody(
        
        tags$head(
          tags$style(type="text/css", "#inline label{ display: table-cell; text-align: left; vertical-align: middle; } 
                                                              #inline .form-group { display: table-row;}")),
        tags$style(HTML("
                      .btn-success.btn {
                      color: #3D85C6;
                      background-color: #fff;
                      border: 1px #666666 solid;
                      }
                      .btn-success.btn:hover {
                      color: #fff;
                      background-color: #3D85C6;
                      }
                      .btn-success.active {
                      color: #fff;
                      background-color: #3D85C6;
                      border-color: #666666;
                      }
                      ")),
        
        # Boxes need to be put in a row (or column)
        fluidRow(
            tags$div(id = "inline",  
                     box(width=3,
                         dateInput("date_A",HTML("Date A"),value = NA, format = "dd-mm-yyyy", startview = "month", width="100px"),
                         numericInput("length","Length [min]",min = 0, max = 1000, step = 1, value = NA, width="100px"),
                         radioGroupButtons("technique","Technique", status= "success", choices = c("a", "b"), selected=""),
                         numericInput("length2",HTML("Length 2 [min] <br/>"),min = 30, max = 120, step = 1, value = 0, width = "150px"),
                         sliderInput("temperature",HTML("<br/>Temperature [°C]"),min = 37, max = 50, step = 1, value = 41, width = "200px"),
                         title = "Info", solidHeader = TRUE, collapsible = TRUE, status = "success")
            ) # box
        )
      )
    )
    
    server <- function(input, output) 
      { 
    }
    shinyApp(ui, server)

我得到图1 figure 1 with above code的格式:

我想使用类似图2(1.-4。)enter image description here

的格式

这可能吗?

0 个答案:

没有答案