<!DOCTYPE html>
<html>
  <head>
    <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>
    <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>
 
$('#example')
    .on('preInit.dt', function (e, settings, data) {
      var api = new DataTable.Api(settings);
  
      $('input.dt-input', api.table().container()).prop('disabled', true);
    })
var table = new DataTable('#example', {
  ajax: function(data, callback) {
    setTimeout(
      function() {
        callback({ "data": [{
          "name": "Bob",
          "position": "Manager",
          "office": "Houston",
          "extn": "+12345",
          "start_date": "2020-01-05",
          "salary": "100000",
        }]});
      },
      10 * 1000
    );
  },
  columns: [
    { data: 'name' },
    { data: 'position' },
    { data: 'office' },
    { data: 'extn' },
    { data: 'start_date' },
    { data: 'salary' },
  ],
});
table.ready(function () {
    $('input.dt-input', table.table().container()).prop('disabled', false);
});
1 error
Line 6: Missing semicolon.
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers