tableOutput: Create a table output element

Description Usage Arguments Value See Also Examples

View source: R/bootstrap.R

Description

Render a renderTable() or renderDataTable() within an application page. renderTable uses a standard HTML table, while renderDataTable uses the DataTables Javascript library to create an interactive table with more features.

Usage

1
2
3
tableOutput(outputId)

dataTableOutput(outputId)

Arguments

outputId

output variable to read the table from

Value

A table output element that can be included in a panel

See Also

renderTable(), renderDataTable().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Only run this example in interactive R sessions
if (interactive()) {
  # table example
  shinyApp(
    ui = fluidPage(
      fluidRow(
        column(12,
          tableOutput('table')
        )
      )
    ),
    server = function(input, output) {
      output$table <- renderTable(iris)
    }
  )


  # DataTables example
  shinyApp(
    ui = fluidPage(
      fluidRow(
        column(12,
          dataTableOutput('table')
        )
      )
    ),
    server = function(input, output) {
      output$table <- renderDataTable(iris)
    }
  )
}

tomkuipers1402/shiny documentation built on Feb. 13, 2020, 7:22 p.m.