<!DOCTYPE html>
<html>
  <head>
<link href="https://nightly.datatables.net/select/css/select.dataTables.css" rel="stylesheet" type="text/css" />
<link href="https://nightly.datatables.net/searchpanes/css/searchPanes.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://code.jquery.com/jquery-3.6.3.js"></script>
    <link href="https://nightly.datatables.net/css/dataTables.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://nightly.datatables.net/js/dataTables.js"></script>
<script src="https://nightly.datatables.net/select/js/dataTables.select.js"></script>
<script src="https://nightly.datatables.net/searchpanes/js/dataTables.searchPanes.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
      <table id="example" class="display" width="100%">
        <thead>
          <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Extn.</th>
            <th>Start date</th>
            <th>Salary</th>
          </tr>
        </thead>
        <tfoot>
          <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Extn.</th>
            <th>Start date</th>
            <th>Salary</th>
          </tr>
        </tfoot>
      </table>
    </div>
  </body>
</html>
 
var table = new DataTable('#example', {
  ajax: '/ajax/objects.txt',
  columns: [
    { data: 'name',
     searchPanes: {
          show: true
        }
    },
    { data: 'position' },
    { data: 'office' },
    { data: 'extn' },
    { data: 'start_date' },
    { data: 'salary' },
  ],
  searchPanes: {
      threshold: 0,
      cascadePanes: true
  },
    layout: {
      top1: 'searchPanes',
  }
    
    });
setInterval(function () {
    table.ajax.reload();
}, 5000);
Output 300px

This bin was created anonymously and its free preview time has expired. Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers