【问题标题】:Shiny align Input controls right or left闪亮的对齐输入控件向右或向左
【发布时间】:2019-03-29 20:04:21
【问题描述】:

我有三个输入控件,希望在闪亮的应用程序中将一个在左侧对齐,两个在页面右侧对齐。此外,两个selectInput 控件必须并排放置,我使用此answer 的代码解决了这一问题。

使用column's 和align = "right" 我能够得到我想要的。问题是文本和选择箭头也是右对齐的,这看起来很糟糕(见下面的图片和突出显示的区域)。

还有其他方法可以实现预期的对齐方式吗?

library(tidyverse) # loaded for the words data.frame
library(shiny)
ui <- fluidPage(
    navbarPage(
      set.seed(1233),
      fluidRow(
       column(8,radioButtons("plot", "", choices = list("Cluster"="1","Correlation"="2"), inline=T)),
       column(4, align = "right",
        div(style="display: inline-block;vertical-align:top; width: 120px;",
            selectInput("Something","Something", choices = sample(words, 5))),
        div(style="display: inline-block;vertical-align:top; width: 120px;",
            selectInput("Else","else", choices = sample(words, 6))))
      )
    )
  )

server <- function(input, output) {}  

shinyApp(ui, server)

【问题讨论】:

    标签: r shiny alignment selectinput


    【解决方案1】:

    我无法为您提供最佳对齐实践的建议,但在这种情况下,您可以添加

    text-align:left !important;
    

    到你的风格参数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-15
      • 2019-01-16
      • 2014-06-30
      • 2011-03-03
      • 2016-07-14
      • 1970-01-01
      • 2020-06-24
      • 1970-01-01
      相关资源
      最近更新 更多