datatable javascript button code example

Example 1: datatable buttons

dom: 'Blfrtip',
    buttons: [
        {
            extend: 'excelHtml5',
            footer: true,
        },
        {
            extend: 'csvHtml5',
            footer: true,
        },
        {
            extend: 'pdfHtml5',
            footer: true,
        },
    ],
    lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],

Example 2: data table buttons

Javascript12345678var table = $('#example').DataTable( {    buttons: [        'copy', 'excel', 'pdf'    ]} );  table.buttons().container()    .appendTo( $('.col-sm-6:eq(0)', table.table().container() ) );

Tags:

Html Example