首页 > 解决方案 > 如何使 Box 内的 bs4Dash Box 显示为内联且宽度相等

问题描述

使用 bs4Dash,我正在尝试创建一个包含其他几个框的框,使它们水平对齐,并且无论窗口有多大或多小,都跨越页面等距离。我能够使用 a 将框对齐div(),但似乎无法使它们的宽度等距。

这是我的可重现示例:

if (interactive()) {
  library(shiny)
  library(bs4Dash)
  
  shinyApp(
    ui = dashboardPage(
      dashboardHeader(),
      dashboardSidebar(),
      dashboardBody(
        fluidRow(
        box(width = 12, div(style="display: inline-block;vertical-align:top;", box(
          solidHeader = FALSE,
          title = "Status summary",
          background = NULL,
          width = 12,
          status = "danger",
          footer = fluidRow(
              descriptionBlock(
                number = "17%", 
                numberColor = "pink", 
                numberIcon = icon("caret-up"),
                header = "$35,210.43", 
                text = "TOTAL REVENUE", 
                rightBorder = TRUE,
                marginBottom = FALSE

            ),
              descriptionBlock(
                number = "18%", 
                numberColor = "secondary", 
                numberIcon = icon("caret-down"),
                header = "1200", 
                text = "GOAL COMPLETION", 
                rightBorder = FALSE,
                marginBottom = FALSE
            )
          )
        )),
        div(style="display: inline-block;vertical-align:top;", box(title = "second box", width = 12))
        )
        )
      ),
      title = "Description Blocks"
    ),
    server = function(input, output) { }
  )
}

标签: rshinyadminltebs4dash

解决方案


推荐阅读