beetzfan
beetzfan

Reputation: 15

Shiny wellpanel height not the same as text in it

Issue: Trying to put textinput options in a wellpanel for aesthetic purposes, but the height of well panel is not the same as the information in it. See image below. enter image description here

When I don't use column(), I don't have a problem, but I prefer to condense the space taken up by the textinput().

Relevant Code:

tags$style(tableHTML::make_css(list('.well', 'border-width', '5px')))

        column(8,
               wellPanel(
                         column(4, textInput("text1", h4("Name"), width = "60%",
                                          value = "Jane Doe"),
                                   textInput("text3", h4("Wind"), width = "60%",
                                          value = "x")),
                         column(4, textInput("text2", h4("Temperature"), width = "60%",
                                          value = "x"),
                                   textInput("text4", h4("Water"), width = "60%",
                                          value = "x")))

        )

Any help is appreciated.

Upvotes: 0

Views: 378

Answers (1)

Stéphane Laurent
Stéphane Laurent

Reputation: 84529

The columns must always be enclosed in a fluidRow:

library(shiny)

ui <- fluidPage(
  fluidRow(
    column(8,
           wellPanel(
             fluidRow(
               column(4, textInput("text1", h4("Name"), width = "60%",
                                   value = "Jane Doe"),
                      textInput("text3", h4("Wind"), width = "60%",
                                value = "x")),
               column(4, textInput("text2", h4("Temperature"), width = "60%",
                                   value = "x"),
                      textInput("text4", h4("Water"), width = "60%",
                                value = "x"))
             )
           )
    )
  )
)

shinyApp(ui, function(input,output){})

Upvotes: 3

Related Questions