    <a class="mb-1 mt-1 mr-1 btn btn-default" href="#" id="export_pdf">PDF</a>
    <a class="mb-1 mt-1 mr-1 btn btn-default" href="#" id="export_xls">XLS</a>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
	<script src='https://www.jqueryscript.net/demo/Export-Table-JSON-Data-To-Excel-jQuery-ExportToExcel/excelexportjs.js'></script>
 <table class="table" id="example">
  <thead class="thead-dark">
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>
    <script type="text/javascript">
	jQuery("body").on("click", "#export_pdf", function () {
		html2canvas($('#example')[0], {
			onrendered: function (canvas) {
				var data = canvas.toDataURL();
				var docDefinition = {
					content: [{
						image: data,
						width: 500
					}]
				};
				pdfMake.createPdf(docDefinition).download("<?php echo $nedirs;?>.pdf");
			}
		});
	});
	jQuery("body").on("click", "#export_xls", function () {
		jQuery("#example").excelexportjs({
			containerid: "list_<?php echo $_GET["ne"];?>", datatype: 'table'
        });
    });
    </script>