Skip to contents

HTML widget to work with tabular data

Usage

tabulator(
  data,
  options = tabulator_options(),
  editable = FALSE,
  luxon = FALSE,
  sheetjs = FALSE,
  theme = c("default", "midnight", "modern", "simple", "site", "bootstrap3",
    "bootstrap4", "bootstrap5", "bulma", "materialize", "semanticui"),
  col_select = NULL,
  width = NULL,
  height = NULL,
  element_id = NULL,
  ...
)

Arguments

data

(data.frame, character or list): In spreadsheet mode data needs to be a list or NULL for an empty spreadsheet.

options

List of setup options. Defaults to tabulator_options().

editable

Whether the table is editable.

luxon

Whether to add luxon HTML dependency, which is required for set_formatter_datetime().

sheetjs

Whether to add sheetjs HTML dependency, which is required for trigger_download() to support downloads of xlsx files.

theme

Name of the theme to be applied to the table.

col_select

Passed to readr::read_csv() if data is a file name.

width, height

Output size.

element_id

Unique ID of the widget element.

...

Named arguments that are appended to the options parameter.

Value

A HTML widget

Details

Dots in column names are replaced by underscores.

See also

tabulatorOutput() for use within Shiny apps

Examples

setup <- tabulator_options(
  spreadsheet = TRUE,
  spreadsheet_sheets = list(
    spreadsheet_def(
      title = "First",
      data = list(c(1, 2, 3))
    ),
    spreadsheet_def(
      title = "Second",
      data = list(c(4, 5, 6))
    )
  ),
  spreadsheet_sheet_tabs = TRUE
)

tabulator(data = NULL, setup, theme = "midnight")