Reputation: 1111
Could you help me to reduce the space between fileInput and text in Shiny? I would like to leave something similar to the Figure that I have attached. The executable code is below.
Thank you!
runApp(
list(ui = fluidPage(
fileInput("data", h3("Excel database import")), uiOutput("tab"),
),
server = function(input, output, session){
url <- a("Google Homepage", href="https://www.google.com/")
output$tab <- renderUI({
tagList("Access the page:", url)
})
})
)
Upvotes: 5
Views: 1369
Reputation: 84709
Alternatively to Pork Chop's solution, you can insert a div
element with a negative margin-top
between the two elements you want to be closer:
ui = fluidPage(
fileInput("data", h3("Excel database import")),
div(style = "margin-top: -30px"),
uiOutput("tab")
)
Upvotes: 10
Reputation: 29417
You can apply some style
to it and adjust it using margin-top
:
library(shiny)
runApp(
list(ui = fluidPage(
tags$head(tags$style(' #tab {margin-top:-30px;}')),
fileInput("data", h3("Excel database import")), uiOutput("tab"),
),
server = function(input, output, session){
url <- a("Google Homepage", href="https://www.google.com/")
output$tab <- renderUI({
tagList("Access the page:", url)
})
})
)
Upvotes: 3