【发布时间】:2020-02-13 03:09:52
【问题描述】:
我的 shinyApp 中有多个输入字段(fileInput、numericInput、textInput),我想自定义它们的高度以及字符大小。
我试过div(),但我只能改变两个字段之间的差距。在这种情况下,设置div(style="height: 60px;",numericInput("rat","RATIO", value = 0,step=0.01 , width = '40%')) 只会减少数字输入字段和滑块之间的距离。
这是一个示例代码:
sidebar <- dashboardSidebar(
sidebarMenu(
div(style="height: 70px;",fileInput('uploadfile',"Select result file(s)", multiple=TRUE,accep=".txt")),
div(style="height: 60px;",numericInput("rat","RATIO", value = 0,step=0.01 , width = '40%')),
div(style="height: 60px;",sliderInput("ratio",NULL, min= 0, max= 1, value = 0)),
textInput("mytext","Enter name",value='', width = '50%')
)
)
ui<-dashboardPage(
dashboardHeader(title = "Analysis"),
sidebar,
body <- dashboardBody()
)
server<-shinyServer(function(input, output, session){})
shinyApp(ui = ui, server = server)
我从来没有做过任何 html,所以我不确定我应该寻找什么。
【问题讨论】: