DT::datatable

Basic DT::datatable

library(DT)
datatable(iris)

Advanced DT::datatable

datatable(iris, filter = 'top', extensions = 'Buttons',  options = list( columnDefs = list(list(width = '70px')),
  searchHighlight = TRUE,pageLength = 20  , dom = 'Bfrtip',
                                                                                                 buttons = 
                                                 list( list(
                                                   extend = 'collection',
                                                  buttons = list(list(extend='csv',filename='iris_summary.csv'),
                                                                 list(extend='excel',
                                                                      filename = 'iris_summary.xlsx') ),text="Download"
                                                               
                                                                                                 
))))

As a function

Make your life even easier: write a simple datatable function that applies your go-to formatting. Add the function to an R script in the dashboard supporting scripts folder that you bring along for every dashboard.