JSFiddle - React, Tailwind, and code Playground

by bagelsesame

HTML

<html>

  <head>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jq-3.6.0/dt-1.12.1/b-2.2.3/sr-1.1.1/datatables.min.css" />
  </head>

  <body>


    <table id="example" class="display nowrap" style="width:100%">
      <thead>
        <tr>
          <th>ID</th>
          <th>First name</th>
          <th>Last name</th>
          <th>ZIP / Post code</th>
          <th>Country</th>
        </tr>
      </thead>
    </table>


    <script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-3.6.0/dt-1.12.1/b-2.2.3/sr-1.1.1/datatables.min.js"></script>
  </body>

</html>

JavaScript

$(document).ready(function() {
  $('#example').DataTable({
    dom: 'Blfrtip',
    buttons: [{
      extend: 'savedStates',
      buttons: [
        'createState',
        'removeAllStates'
      ],
      config: {
        ajax: function(data, callback) {
        	alert("ajax function is called!");
        }
      }
    }]
  });
});