Table export

Export table pdf excel

by Rapha Souza

HTML

<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<script src="https://www.jqueryscript.net/demo/ultimate-export/libs/FileSaver/FileSaver.min.js"></script>
<script src="https://www.jqueryscript.net/demo/ultimate-export/libs/js-xlsx/xlsx.core.min.js"></script>
<script src="https://www.jqueryscript.net/demo/ultimate-export/libs/jsPDF/jspdf.umd.min.js"></script>
<script src="https://www.jqueryscript.net/demo/ultimate-export/tableExport.js"></script>
<a href="#" onclick="$('#tableExport').tableExport({type:'excel',
                                                           mso: {
                                                             fileFormat:'xlsx'
                                                           },
                                                           ignoreColumn: [10, 'button']
                                                           });">
  <br>&nbsp;<b>Click to export to Excel ('xlsx' = Excel 2007 Office Open XML format)</b>
</a>
<a href="#" onclick="    $('#tableExport').tableExport({
        type: 'pdf',
        jspdf: {
            orientation: 'l',
            margins: { 
            right: 10, 
            left: 10, 
            top: 40, 
            bottom: 40 
            },
            autotable: { 
                tableWidth: 'auto',
                  styles: {
                    overflow: 'linebreak'
                    }
            }
            
        },
        ignoreColumn: [10, 'button']
    });
">
  <br>&nbsp;<b>Click to export to PDF (jsPDF / jsPDF-AutoTable)</b>
</a>

<table id="tableExport" class="table...