代码之家  ›  专栏  ›  技术社区  ›  Roman

右对齐或左对齐输入控件

  •  0
  • Roman  · 技术社区  · 7 年前

    selectInput answer

    column 的和 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)
    

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  0
  •   fenix_fx    7 年前

    我不能给你关于对齐的最佳实践的建议,但是在这种情况下,你可以添加

    text-align:left !important;
    

    推荐文章