如何在标题的左侧对齐它

时间:2018-01-03 14:13:59

标签: r shiny shinydashboard

i want to algin it left side in header,i had shared a screen shot here

//ui.r

    library(RJDBC)
    library(dplyr)
    library(shiny)
    library(ggplot2)
    library(scales)
    library(shinydashboard)
    library(gridExtra)
    library(DT)
    library(reshape2)
    library(ggthemes)
    library(plotly)

dashboardPage(

  dashboardHeader( 

    tags$li(class = "dropdown",
       navbarPage("header",tabPanel("Plots",style = "align:right;"), tabPanel("Plot1"), tabPanel("Plot2"), tabPanel("Plot3"), tabPanel("Plot4")))

  ),


  dashboardSidebar(


    sidebarMenuOutput(outputId = "sidebar"),
    uiOutput("sidebarmenu")
  ), 
  dashboardBody(


    uiOutput("body"),
    uiOutput("tabbox"),

    uiOutput("dashboardbody")



  )

)

2 个答案:

答案 0 :(得分:0)

我们可以做这样的事情

CustomHeader <- dashboardHeader(title="Store Analytics")
    CustomHeader$children[[3]]$children <- list(
      div(style="float:left;height:55px",uiOutput("try")))

    dashboardPage(

      CustomHeader,
)

答案 1 :(得分:0)

除了 ROHIT JHA 给出的答案之外,我们可以在dashboardBody中添加以下两个css标签。

tags$head(tags$style(".main-header .navbar{ margin-left: 0px !important;}")),
tags$head(tags$style(".navbar-custom-menu, .main-header .navbar-right {float: left !important;}")),

添加此内容后,您会看到以下内容:

enter image description here