2

I want to display some text with R shiny:

 h4("Hello world!   \t \t   Hier I'm)

How can I add tab symbols into the text?

Marta
  • 3,493
  • 6
  • 28
  • 43

2 Answers2

3

You can't really directly enter a tab character like you can in R. You can insert consecutive   values for spaces - this example puts 4 spaces into the space that you have above:

h4("Hello world!    Hier I'm)

Alternatively you can add padding or margin to your CSS for h4 tags. See this link for explanation:

HTML: Tab space instead of multiple non-breaking spaces ("nbsp")?

Community
  • 1
  • 1
MDe
  • 2,478
  • 3
  • 22
  • 27
2

The pre tag preserves spaces and line breaks; and escaped characters like \t are interpreted. For example : tags$pre(h4("Hello world! \t \t Hier I'm)).

Julien Navarre
  • 7,653
  • 3
  • 42
  • 69