I am trying to make something (or as I thought) relatively simple. I have a simple shiny page with only a text box and actionButton.
I want them both to appear in the center (vertical and horizontal) of the window.
The way I started doing this is to use a fluid with two fluids, one for each element:
library(shiny) library(shinyapps) shinyUI(fluidPage(theme = "bootstrap.css", fluidRow( column(8, align="center", offset = 2, textInput("string", label="",value = ""), tags$style(type="text/css", "#string { height: 50px; width: 100%; text-align:center; font-size: 30px;}") ) ), fluidRow( column(6, align="center", offset = 3, actionButton("button",label = textOutput("prediction")), tags$style(type='text/css', "#button { vertical-align: middle; height: 50px; width: 100%; font-size: 30px;}") ) ) ) )
I can make the button appear in the center (horizontal), but not in the text input field. If I do not specify a width for textInput, it will be centered, but if I increase it, it will extend it to the right and, therefore, will no longer sit in the center. Ideally, I would like it to occupy 100% of the width of the column (which is why I determined the size of column 8 and offset 2) in the same way as the button, but when I specify the percentage width, it does not change.
In addition to this, I would like the text and the button to appear in the vertical center of the window, but I do not know how to approach this, in addition to inserting a fictitious liquid. Before you first eat some space.
Thanks for any help, I think I probably spent more time trying to display this page correctly than I have on the rest of the application.