css - Shiny 的井板宽度

标签 css r shiny shinydashboard

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    wellPanel(tags$div(id="pane",
    fluidRow(
      column(width = 6,valueBox("test","test1"),
             valueBox("test","test2"))),
    fluidRow(
      column(width = 6,valueBox("test","test3"),
             valueBox("test","test4")

             ))), 
    tags$style(type="text/css","#pane{font-size:20px;}"))

    ))
# )




server <- function(input, output) {}

shinyApp(ui, server)

结果

enter image description here

但是,我只需要突出显示的部分;即 wellpanel 宽度应按照框

enter image description here

这只是一个示例,除了带有不同的井板之外,我还将添加四个盒子。

最佳答案

尝试在 valueBox 中使用宽度

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(column(width = 6, wellPanel(tags$div(id="pane",
         fluidRow(valueBox(width = 6, "test","test1"), valueBox(width = 6, "test","test2")),  
         fluidRow(valueBox(width = 6, "test","test3"), valueBox(width = 6, "test","test4")), 
         tags$style(type="text/css","#pane{font-size:20px;}")
    ))))
  )
) 

server <- function(input, output) {} 
shinyApp(ui, server)

关于css - Shiny 的井板宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39899082/

相关文章:

javascript - 在 mdl 模板上 Bootstrap scrollspy

r - 如何在表示 ggplot2 中所有观测值的 x 轴上添加因子水平?

r - 在 Shiny 的应用程序中加载非基础 R 数据集

带有转置开关的 R Shiny 表

r - 将鼠标悬停在 R shiny selectInput 上时是否可以显示信息文本?

javascript - 菜单滑出后使按钮中的箭头指向下方

css - 如何自定义Gitkit提供的登录按钮?

javascript - 单击另一个标签时激活标签(:active)

r - 如何在交互式 session 中读取 knitr/Rmd 缓存?

r - 与dplyr异样变异