Introduction

Table Download Example

library(DT)
datatable(
     iris,
     extensions = 'Buttons', options = list(
         pageLength = 50,
         dom = 'Bfrtip',
         buttons = 
             list('copy', 'print', 'colvis', list(
                 extend = 'collection',
                 buttons = c('csv', 'excel', 'pdf'),
                 text = 'Download'
             )),
         rowCallback = JS('
            function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
                                      // Bold and green cells for conditions
                                      var $nRow = $(nRow);
                                      if (parseFloat(aData[3]) >= 1.5)
                                      $nRow.css({"background-color":"#F08080"});
                                      if (parseFloat(aData[3]) < 1.5)
                                      $nRow.css({"background-color":"#98FB98"});
                                       }')

         
     )
 )