【问题标题】:Reducing the inputs in TextInput widget减少 TextInput 小部件中的输入
【发布时间】:2019-06-12 22:30:14
【问题描述】:

我对 RShiny 非常陌生,因此尝试创建一个仪表板,在该仪表板中,将根据单击 actionButtons 预填充表单。我在这个表单中有多个字段。我想减小 TextInput 小部件中输入的大小。我尝试了以下代码:

div(style="height: 60px;",textInput("pt1", label = div(style = "font-size:11px","Patient ID"),value="12499")),

但这不起作用。如果您能提出一些适合页面中这些字段的方法,那就太好了。我能够减少文本标签,但条目占用了太多空间。

【问题讨论】:

    标签: shiny


    【解决方案1】:

    您可以通过添加类input-sm 来输入更小的文本。这是一种方法:

    smallInput <- function(tag) {
      tag$children[[2]] <- htmltools::tagAppendAttributes(tag$children[[2]], class = "input-sm")
      tag
    }
    

    在你的用户界面中,做

    smallInput(textInput("pt1", label = div(style = "font-size:11px","Patient ID"),value="12499"))
    

    【讨论】:

      猜你喜欢
      • 2015-05-30
      • 1970-01-01
      • 2014-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-27
      相关资源
      最近更新 更多