Guest User

Untitled

a guest
Mar 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. <TABLE aria-describedby="DataTables_Table_2_info" role="grid" id="DataTables_Table_2" class="table table-tools table-dynamic table-[object Object] dataTable" style="">
  2. <thead>
  3. <TR role="row">
  4. <TH aria-label="Head 0: activate to sort column ascending" style="width: 0px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_2" tabindex="0" class="sorting">DEPARTMENT
  5. </TH>
  6. <TH aria-label="Head 0: activate to sort column ascending" style="width: 0px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_2" tabindex="0" class="sorting">DATE
  7. </TH>
  8. </tr>
  9. </thead>
  10. <tbody>
  11. <tr class="odd" role="row" >
  12. <td class="sorting_1">
  13. <font color="#000000" size="2.5em"><a href="#" class="tooltips"><u>Accounts Department<span class="tooltiptext">3rd Floor West Building</span></u></a></font>
  14. </td>
  15. <td class="sorting_1" align=center >
  16. <font color="green"> 0.00%</font>
  17. </td>
  18. </tr>
  19. </tbody>
  20. </table>
  21.  
  22. fnClick:function(e,t,s)
  23. {
  24. this.fnSetText(s,this.fnGetTableData(t))
  25. }
  26. }),
  27. xls:e.extend({},
  28. TableTools.buttonBase,
  29. {
  30. sAction:"flash_save",
  31. sCharSet:"utf16le",
  32. bBomInc:!0,
  33. sButtonClass:"DTTT_button_xls",
  34. sButtonText:"<i class='fa fa-file-excel-o'></i>"
  35.  
  36. $(document).ready(function() {
  37. var oTable = $('#DataTables_Table_2').DataTable( {
  38. dom: 'Blfrtip',
  39. buttons: [
  40. {
  41. extend: 'csv',
  42. exportOptions: {
  43. columns: [1,2] //include the columns you want here. 1st column is 0
  44. }
  45. }
  46. ]
  47. } );
  48. } );
  49.  
  50. <table id="exampleTable">
  51. <thead>
  52. <tr role="row">
  53. <th aria-hidden="true">DEPARTMENT</th> <!-- Used in data export -->
  54. <th aria-label="Head 0: activate to sort column ascending" style="width: 0px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_2" tabindex="0" class="sorting">DEPARTMENT
  55. </th> <!-- used in browser UI -->
  56. <th aria-label="Head 0: activate to sort column ascending" style="width: 0px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_2" tabindex="0" class="sorting">DATE
  57. </th>
  58. </tr>
  59. <thead>
  60. <tbody>
  61. <tr>
  62. <td>Accounts Department</td>
  63. <td><font color="#000000" size="2.5em"><a href="#" class="tooltips"><u>Accounts Department<span class="tooltiptext">3rd Floor West Building</span></u></a></font></td>
  64. <td>03/20/2018</td>
  65. </tr>
  66. </tbody>
  67. </table>
  68.  
  69. $('#reportTable').DataTable({
  70. columnDefs: [
  71. // hide the first column from browser display (starts at 0)
  72. {'targets':[0], 'visible':false, 'searchable':false}
  73. ],
  74. buttons: [
  75. // configure the export to excel button (export to csv is similar)
  76. {
  77. extend: 'excelHtml5',
  78. title: "Example Excel Export",
  79. exportOptions: {
  80. columns: [0,2] // include the UI hidden column 0 and date column 2 (excludes the UI visible department column 1)
  81. }
  82. }
  83. ]
  84. });
Add Comment
Please, Sign In to add comment