<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
    </div>
  </body>
</html>
 
body {
  font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fff;
}
 
var table = document.createElement('table');
table.innerHTML = '<thead>'+
  '  <tr><th>1</th><th>2</th></tr>'+
  '</thead>'+
  '<tbody>'+
  '  <tr><th>3</th><th>4</th></tr>'+
  '  <tr><th>5</th><th>6</th></tr>'+
  '  <tr><th>7</th><th>8</th></tr>'+
  '</tbody>';
var dt = new DataTable(table);
document
  .querySelector('div.container')
  .appendChild(dt.table().container());
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers