Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add multiple line breaks conveniently in shiny?

I want put multiple line breaks in my shiny app. Instead of

br(),
br(),
br(),
...

is there any more convenient way of doing it?Thanks.

like image 486
rankthefirst Avatar asked Oct 04 '17 07:10

rankthefirst


1 Answers

I have no idea if that's convenient for you, but it saves you some typing.

linebreaks(n) repeats <br/> n times and parses it as HTML.

library(shiny)


linebreaks <- function(n){HTML(strrep(br(), n))}

ui <- fluidPage(

  titlePanel(
              p( 
                  h1("first sentence", align = "center"),

                  linebreaks(10),

                  h3("second sentence", align = "center")
                )
              )
  )

like image 136
Humpelstielzchen Avatar answered Oct 01 '22 10:10

Humpelstielzchen