我想将selectizeInput()
添加到我的闪亮应用中的标题的一行中。此外,我想将标题左侧与selectizeInput()
对齐。
我试过了:
shinyUI(fluidPage(
theme = shinytheme("simplex"),
titlePanel(title = div(div(style = "display: inline-block; ",
"My shiny application"),
div(style = "width: 200px; display: inline-block;
float: right; ",
selectInput(inputId = "opt",
label = "",
choices = c("opt1", "opt2", "opt3"),
selected = "opt1")))),
sidebarLayout(
sidebarPanel(),
mainPanel(),
fluid = F)
))
但标题和selectInput()
不在同一行。当我排除float: right
时,它们是,但它们没有正确对齐。
欢迎任何建议!
答案 0 :(得分:1)
您可以使用以下内容:
shinyUI(fluidPage(
theme = shinytheme("simplex"),
tagList(div(div(style = "display: inline-block; ",
h1("My shiny application"),class="main_title"),
div(style = "width: 200px; display: inline-block;
float: right; ",
selectInput(inputId = "opt",
label = "",
choices = c("opt1", "opt2", "opt3"),
selected = "opt1")))),
sidebarLayout(
sidebarPanel(),
mainPanel(),
fluid = F)
))