在Shiny中设置dateInput()字段的高度

时间:2018-08-29 13:45:35

标签: css r shiny

我在一个闪亮的应用程序上有很多生成的输入字段,我想通过降低dateinput字段的高度使其更密集。但是,height标签只会缩小框并使其溢出到下一个输入中。那么,如何缩小dateInput()字段,使其仅比文本字段高一点?

library(shiny)

ui <- fluidPage(
   tags$style(".shiny-date-input  {height : 30px;}")
  ,dateInput("date1","date1")
  ,dateInput("date2","date2")
  ,textInput("text","text")
)

shinyApp(ui, function(input, output, session){})

enter image description here

更新:为明确起见,我希望dateInput(可能还有textinput)框架的高度不高,而不会扩展到打击输入中: enter image description here

2 个答案:

答案 0 :(得分:0)

您可以将类pickerView(_:didSelectRow:inComponent:) -> Int添加到小部件中,以使其更小一些。为此,请使用titleForRow:

input-sm

答案 1 :(得分:0)

<input type="text" name="title" value="{{ old('username') }}"> <span class="error">{{$error->title}}</span> 中找到了答案:

.form_control

enter image description here