I figured this out when developing this question. Divide the hard answer you get here:
It is not enough just to include the appropriate JS assets (jquery.dataTables.min.js, dataTables.buttons.min.js, etc.). You should also call the Buttons plugin, or by expanding the default values ββusing the button object element:
// Invoke Buttons plugin (Bfrtip...) $.extend($.fn.dataTable.defaults, { buttons: [ 'copy', 'csv', 'excel' ] });
Or you can call it with dataTable() initialization:
$("#table2").DataTable({ buttons: [ 'copy', 'excel', 'pdf' ] });
See https://jsfiddle.net/jhfrench/at83rcoL/8/ for examples of both approaches working .
source share