Hiding Columns

Hiding Columns based on con

by David Le Clear

HTML

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/colreorder/1.3.2/js/dataTables.colReorder.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/colreorder/1.3.2/css/colReorder.bootstrap.min.css">
<table id="example" class="display table table-striped table-bordered dt-responsive nowrap">
    <thead>
      <tr>
        <th>Col1</th>
        <th>Col2</th>
        <th>Col3</th>
        <th>Col4</th>
        <th>Col5</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>some data</td>
        <td>some data</td>
        <td>some data</td>
        <td>some data</td>
        <td>some data</td>
      </tr>
      <tr>
        <td>some data</td>
        <td>some data</td>
        <td>some data</td>
        <td>some data</td>
        <td>some data</td>
      </tr>
    </tbody>
  </table>

JavaScript

$(document).ready(function() {
  var table = $('#example').DataTable( {
  	colReorder: true
  });

});