将文本放在闪亮的仪表板主体的中间

问题描述

如何才能在这个高度将文本准确地放置在闪亮的仪表板主体左右端之间的中间?

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),dashboardSidebar(disable = T),dashboardBody(
    fluidRow(
      column(5,),column(4,span(h2(strong("Covid-19 Situation Dashboard"),style = 'font-size:30px;color:#6cbabf;')))
    )
  )
)

server <- function(input,output) { }

shinyApp(ui,server)

解决方法

使用 align = "center",如下所示。

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),dashboardSidebar(disable = T),dashboardBody(
    fluidRow(
      #column(5,),column(12,span(h2(strong("Covid-19 Situation Dashboard"),align = "center",style = 'font-size:30px;color:#6cbabf;')))
    )
  )
)

server <- function(input,output) { }

shinyApp(ui,server)