datatables
packageThe main function in this package is datatable()
.
With the iris
dataset.
library(DT)
datatable(iris, options = list(pageLength = 5))
We can change the CSS, display row names, customize column names, customize table container, add and customize caption, add column filters, and more.
library(DT)
datatable(head(iris),
options = list(pageLength = 5, autoWidth = TRUE),
class = 'cell-border stripe', # 'cell-border stripe', 'display', 'compact', 'cell-border'
caption = 'Table 1: This is a simple caption for the table.',
filter = 'top')