simple_table: Simple HTML table

View source: R/simple_table.R

simple_tableR Documentation

Simple HTML table

Description

Simple HTML table

Usage

simple_table(data, colnames = TRUE, rownames = FALSE)

Arguments

data

A data.frame

colnames

(logical) Whether or not to show the column names (a header row)

rownames

(logical) Whether or not to show the row names

Examples

app <- dash_app() %>%
  set_layout(
    dashCoreComponents::dccChecklist(
      id = "table_params",
      labelStyle = list(display = "block"),
      options = list(
        list(label = "Header", value = "colnames"),
        list(label = "Row names", value = "rownames")
      )
    ),
    br(),
    div(id = "table")
  )

app %>% add_callback(
  output(id = 'table', property = 'children'),
  input(id = 'table_params', property = 'value'),
  function(val) {
    simple_table(mtcars, colnames = "colnames" %in% val, rownames = "rownames" %in% val)
  }
)

app %>% run_app()

daattali/dash2 documentation built on July 1, 2023, 9:28 a.m.