如何将选项卡移动到R闪亮中侧边栏的底部? [英] How to move a tab to the bottom of the sidebar in R Shiny?
本文介绍了如何将选项卡移动到R闪亮中侧边栏的底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个用shinyDashboardPlus
构建的闪亮仪表板。我有一个带有几个选项卡的侧边栏-像往常一样,它们在左上角对齐。
我的侧边栏滚动已通过style = "position: fixed;"
修复。
我想添加一个帮助/联系人选项卡,但我希望它位于侧边栏的左下角。我该怎么做?
推荐答案
您必须通过css设置相应li标记的样式。
请检查以下内容:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Simple tabs"),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Widgets", icon = icon("th"), tabName = "widgets",
badgeLabel = "new", badgeColor = "green")
)
),
dashboardBody(
tags$head(
tags$style(HTML("
#sidebarItemExpanded > ul > :last-child {
position: absolute;
bottom: 0;
width: 100%;
background-color: red;
}
"))),
tabItems(
tabItem(tabName = "dashboard",
h2("Dashboard tab content")
),
tabItem(tabName = "widgets", id = "widgetstabid",
h2("Widgets tab content")
)
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
这篇关于如何将选项卡移动到R闪亮中侧边栏的底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文