<!DOCTYPE html>
 
<body>
  <table class="display nowrap" style="margin:auto;width:100%" id="table">
    <thead>
      <tr>
        <th>A</th>
        <th>B</th>
      </tr>
    </thead>
    <tbody>
    </tbody>
  </table>
 
 
  <link href="https://www.unpkg.com/dt_for_itables@2.0.10/dt_bundle.css" rel="stylesheet" />
  <script type="module">
    import { DataTable } from 'https://www.unpkg.com/dt_for_itables@2.0.10/dt_bundle.js';
 
    document.querySelectorAll("#table:not(.dataTable)").forEach(table => {
      // Define the table data
      const data = [["a", "b"]];
 
      // Define the dt_args
      let dt_args = { "scrollX": true, "layout": { "topStart": null, "topEnd": null, "bottomStart": null, "bottomEnd": null } };
      dt_args["data"] = data;
 
      let dt = new DataTable(table, dt_args);
    });
  </script>
</body>
 
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers