【发布时间】:2018-07-20 13:09:48
【问题描述】:
我有两个问题:
1) 我想提供几个看起来像表格的文本输入字段。我的解决方案没问题,但是由于每个字段所需的标题,行之间的空间太大。如何缩短文本输入字段之间的距离?
2) 输出应为包含来自输入的数据的 data.frame。如何使用“Output$contents”中的输入数据创建 data.frame?
谢谢。
代码摘录:
ui <- fluidPage(
# App title ----
titlePanel("Stochastische Cashflows"),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
h4("Psychologisch motivierte Abflüsse aus Einlagen"),
tags$hr(),
fluidRow(
column(6,
textInput("file1", "Passive Bilanzpostionen eingeben"),
textInput("file2", "")
),
column(6,
textInput("file3", "Passive Bilanzpostionen eingeben"),
textInput("file4", "")
)
),
),
# Main panel for displaying outputs ----
mainPanel(
# Output: Data file ----
tableOutput("contents"),
)
)
)
################################################################################################################
################################################################################################################
server <- function(input, output) {
output$contents <- renderTable({
print(9)
})
################################################################################################################
################################################################################################################
# Create Shiny app ----
shinyApp(ui, server)
###########################################################################################################
【问题讨论】:
-
您可以使用 css 为您的应用程序设置样式