2

Shiny displays text box and title in blocks, by default. I am trying to have it display inline.

I wasn't able to find R code to fix this issue. So I typed out the html and put it in HTML() function to make the code display textbox and its title inline. But it didn't work. Title and textbox still appear in blocks. Does anyone have a workaround ?

Shiny R Code:

library(shiny)
ui<-fluidPage(textInput("name","Name"))
server<-function(input,output){}
shinyApp(ui=ui,server=server)

HTML inside Shiny R Code:

library(shiny)
ui<-fluidPage(HTML('<html>
<head>
<style>  .container-fluid .form-group .control-label{display: 
inline;} 
</style>
</head>
<body>
<div class="container-fluid">
<div class="form-group shiny-input-container">
<label class="control-label" for="t1">Name</label>
<input id="t1" type="text" class="form-control" value=""/>
</div>
</div>
</body>
</html>'))

Desired Output:

img1

Actual Shiny Output

img2

camille
  • 16,432
  • 18
  • 38
  • 60
  • This is an interesting question but you should have a better title, something like `How to have R Shiny textInput title inline with box` – Simon Woodward Nov 07 '19 at 21:01
  • The following seems to answer your question. I like solution 2 the best. https://stackoverflow.com/a/45857261/8485287 – Adam Sampson Nov 07 '19 at 21:07

0 Answers0