Приложение ниже содержит fileInput
и actionButton
. Я хотел бы выровнять два элемента по вертикали так, чтобы actionButton
совпал с кнопкой Browse
на fileInput
. В дополнение к приведенному ниже коду я также пробовал display:flex
и align-items:center;
, а также fluidRow(column(width = 9, ...), column(width = 3, ...))
безрезультатно. Я не уверен, что мне не хватает, и любая помощь будет высоко ценится.
Вот приложение:
library(shiny)
library(shinydashboard)
# UI ----------------------------------------------------------------------
ui = fluidPage(
tagList(
box(
width = 5,
tags$div(style = "display:inline-block; width:75%;",
fileInput(
inputId = 'file',
label = 'Select file:',
accept = c('.txt', '.csv', '.xls', '.xlsx', '.rds', '.dta', '.sas7bdat', '.sav')
)
),
tags$div(style = "display:inline-block; width:20%;",
div(class = 'pull-right',
actionButton('upload', 'Upload')
)
)
)
)
)
# SERVER ------------------------------------------------------------------
server <- shinyServer(function(input, output, session) {})
shinyApp(ui, server)
Результат:
![enter image description here](https://i.stack.imgur.com/KvwtR.png)