govuk_datatable: datatables for GOV.UK

View source: R/govuk_datatable.R

govuk_datatableR Documentation

datatables for GOV.UK

Description

govuk_datatable is a wrapper for DT::datatable() that will enable the govuk-hugo theme to apply GOV.UK CSS classes to the output.

Usage

govuk_datatable(
  data,
  title = NULL,
  element_id = NULL,
  col_names = NULL,
  page_length = 10,
  search = FALSE,
  small_text = FALSE,
  buttons = TRUE,
  col_defs = NULL,
  copy_info = NULL,
  export_file = NULL,
  options = NULL
)

Arguments

data

the data frame to display

title

a title/caption for the table

element_id

optionally, an id for the resulting HTML chunk

col_names

optionally, a vector of column names, otherwise the names of the data object

page_length

the number of rows to show per page, default is 10

search

whether to include the search box

small_text

whether to render the table content with a smaller font

buttons

whether to include copy and download buttons

col_defs

optionally, a list of column definitions

copy_info

information to include when copying the file

export_file

the file name for the exported csv

options

optionally, a list of additional options to pass to DT::datatable()


co-analysis/govuk-hugo-r documentation built on June 23, 2022, 5:44 a.m.