gpt4 book ai didi

html - 与 selectizeInput 内联的标题

转载 作者:行者123 更新时间:2023-11-28 15:18:33 26 4
gpt4 key购买 nike

我想将 selectizeInput() 添加到我 Shiny 的应用程序的标题行中。此外,我想将标题向左对齐,将 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)
))

但是header和selectInput()不在同一行。当我排除 float: right 时,它们是,但它们没有正确对齐。

欢迎提出任何建议!

最佳答案

你可以这样使用:

 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)
))

关于html - 与 selectizeInput 内联的标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46635301/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com