向右或向左闪亮对齐输入控件

时间:2018-10-25 09:01:50

标签: r shiny alignment selectinput

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

使用columnalign = "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)

enter image description here

1 个答案:

答案 0 :(得分:0)

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

text-align:left !important;

设置为您的样式参数