1library(shiny)
2library(DT)
3
4shinyServer(function(input, output, session) {
5
6  mtcars2 = data.frame(
7    name = rownames(mtcars), mtcars[, c('mpg', 'hp')],
8    stringsAsFactors = FALSE
9  )
10  mtcars2$am = factor(mtcars$am, labels = c('automatic', 'manual'))
11  mtcars2$date = Sys.Date() + seq_len(nrow(mtcars))
12
13  output$tbl = DT::renderDataTable(
14    mtcars2, filter = 'top', server = TRUE, rownames = FALSE,
15    options = list(autoWidth = TRUE)
16  )
17})
18