add the export to file functionality in datatables

add the export to file functionality in datatables

hattricknzhattricknz Posts: 10Questions: 6Answers: 0

How do I add the export to file functionality in datatables described here

here is my basic fiddle with 2 rows of test data
https://jsfiddle.net/sxqeauaz/

Am I correct to say that I should just add all the libraries js and css, and the following piece of code

$(document).ready(function() {
    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
    } );
} );

I have done this in the below fiddle but it does not work.
https://jsfiddle.net/sxqeauaz/1/

Can anyone advise how i get the csv, pdf, copy...etc buttons to work?
The way I describe above is obviously too simple to get it to work.
Maybe my reading of the documentation is not the best.
Would really appreciate some advise on this matter.

This discussion has been closed.