Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a print option with jquery data table plugin

I am using following codes for making table as grid

oTable = $('#search_table').dataTable({
    "bJQueryUI": true,
    "sScrollY": "200px",
    "bPaginate": true,
    //"bAutoWidth": true,
    "sPaginationType": "full_numbers",
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
        "aButtons": [{
            "sExtends": "print",
            "sMessage": "Generated by DataTables"
        }]
    },
    "aoColumns": [
        null,
        null,
        null,
        null,
        null,
        null,
        null, {
            "bSortable": false
        }, {
            "bSortable": false
        },
        null,
    ]
});

Question: I need to print the table which is used in datatable plugins. whether any option for print is there with data table plugin.

Thanks in advance...

like image 861
Mohan Ram Avatar asked Dec 21 '22 09:12

Mohan Ram


1 Answers

This add–on might help you: http://www.datatables.net/extras/tabletools/

TableTools is a plug-in for the DataTables HTML table enhancer, which adds a highly customisable button toolbar to a DataTable. Key features include:

  • Copy to clipboard
  • Save table data as CSV, XLS or PDF files
  • Print view for clean printing
  • Row selection options
  • Easy use predefined buttons
  • Simple customisation of buttons
  • Well defined API for advanced control...
like image 74
polarblau Avatar answered Dec 26 '22 18:12

polarblau