2

I have a shiny app, and I want to add a small line break in between 2 objects--is it possible to specify that you want br() to be half it's regular size? I know if I wanted it to be double the size, I'd do br(), br(), but I don't know how to make it smaller.

J.Sabree
  • 2,280
  • 19
  • 48
  • 2
    Does [this post](https://stackoverflow.com/questions/24467036/make-a-half-row-break-br/24467127) answer your question? `
    `
    – Rich Pauloo Sep 08 '21 at 18:24
  • With shiny syntax: `shiny::tags$br(style="line-height: 10px")`. Remember shiny just generates HTML. If you want to style that HTML, use CSS. – MrFlick Sep 08 '21 at 18:38

1 Answers1

2

Instead of br() you can add a margin to the bottom of the element of any size.

library(shiny)

ui <- fluidPage(
  p("Line 1"),
  br(),
  p("Line 2", style = "margin-bottom: 0px;"),
  p("Line 3", style = "margin-bottom: -10px;"),
  p("Line 4")
)

server <- function(input, output) {
}

shinyApp(ui = ui, server = server)
Geovany
  • 5,389
  • 21
  • 37