Learn R Programming

shiny (version 1.9.1)

column: Create a column within a UI definition

Description

Create a column for use within a fluidRow() or fixedRow()

Usage

column(width, ..., offset = 0)

Value

A column that can be included within a fluidRow() or fixedRow().

Arguments

width

The grid width of the column (must be between 1 and 12)

...

Elements to include within the column

offset

The number of columns to offset this column from the end of the previous column.

See Also

fluidRow(), fixedRow().

Examples

Run this code
## Only run examples in interactive R sessions
if (interactive()) {

ui <- fluidPage(
  fluidRow(
    column(4,
      sliderInput("obs", "Number of observations:",
                  min = 1, max = 1000, value = 500)
    ),
    column(8,
      plotOutput("distPlot")
    )
  )
)

server <- function(input, output) {
  output$distPlot <- renderPlot({
    hist(rnorm(input$obs))
  })
}

shinyApp(ui, server)



ui <- fluidPage(
  fluidRow(
    column(width = 4,
      "4"
    ),
    column(width = 3, offset = 2,
      "3 offset 2"
    )
  )
)
shinyApp(ui, server = function(input, output) { })
}

Run the code above in your browser using DataLab