Skip to contents

This function is a wrapper around the DT::datatable function, containing useful defaults. This function is particularly useful when to provide interactivity (eg. sorting, saving) to tables when rendering documents using RMarkdown or Quarto.

Usage

render_datatable(
  df,
  extensions = c("Buttons"),
  class = c("compact", "stripe", "hover", "row-border"),
  rownames = FALSE,
  options = list(dom = "Bfrtip", buttons = c("copy", "csv"), scrollX = TRUE, scrollY =
    TRUE),
  height = 400,
  ...
)

Arguments

df

Dataframe to render

extensions

Extensions parameter passed to DT::datatable

class

Class parameters passed to DT::datatable

rownames

(logical) Include rownames in output (Default = FALSE)

options

List of options passed to DT::datatable

height

Height of output (Default = 400)

...

Additional arguments passed to DT::datatable

Value

An HTML widget

Examples

render_datatable(datasets::mtcars)