Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aligning a text vertically in R shiny

After having tried various things I found that straighforward but useful way of moving vertically a piece of text and want to share it so that other users of Stacks may benefit of it (as I myself benefit A LOT of thi site):

If you do

fluidRow(
column(width=1,offset=1, h4("Test")),
column(width=2,offset=1, numericInput("sf1.2", label = "Mesure #1", value = 0))

in a ui.R script with R shiny, you notice that "test" is off by regards to the numeric input. To have "test" nicely centered by regards to the numeric input just use the padding option:

fluidRow(
column(width=1,offset=1, h4("Test", style="padding:20px;")),
column(width=2,offset=1, numericInput("sf1.2", label = "Mesure #1", value = 0))
like image 385
Xavier Prudent Avatar asked Sep 07 '25 15:09

Xavier Prudent


1 Answers

just use the padding option:

fluidRow(
column(width=1,offset=1, h4("Test", style="padding:20px;")),
column(width=2,offset=1, numericInput("sf1.2", label = "Mesure #1", value = 0))
like image 182
Xavier Prudent Avatar answered Sep 10 '25 07:09

Xavier Prudent