<!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>
<link href="https://cdn.datatables.net/rowgroup/1.1.3/css/rowGroup.dataTables.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.datatables.net/rowgroup/1.1.3/js/dataTables.rowGroup.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
      <table id="example" class="display nowrap" width="100%">
        <thead>
          <tr>
            <th>index</th>
            <th>value</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>a</td>
            <td>60</td>
          </tr>
          <tr>
            <td>a</td>
            <td>40</td>
          </tr>
          <tr>
            <td>b</td>
            <td>60</td>
          </tr>
          <tr>
            <td>b</td>
            <td>10</td>
          </tr>
          <tr>
            <td>c</td>
            <td>60</td>
          </tr>
        </tbody>
      </table>
    </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;
}
 
$(document).ready( function () {
  var table = $('#example').DataTable({
    order: [[0, 'asc']],  // Sort by index column
    columnDefs: [
      {
        targets: 0,
        orderData: [0, 1]
      }
    ],
    rowGroup: {
      dataSrc: [0], 
    }
  });
} );
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers