jQuery Datatables responsive example
HTML
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<link rel="stylesheet" href="//cdn.datatables.net/1.10.1/css/jquery.dataTables.css">
<script src="//cdn.datatables.net/1.10.1/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="//cdn.datatables.net/responsive/1.0.0/css/dataTables.responsive.css">
<script src="//cdn.datatables.net/responsive/1.0.0/js/dataTables.responsive.js"></script>
<table class="table table-striped no-footer dataTable" id="resultsGrid" aria-describedby="resultsGrid_info" style="width: 894px;">
<thead>
<tr><th colname="EnrolementId" scope="col" class="sorting sorting_asc" tabindex="0" aria-controls="resultsGrid" rowspan="1" colspan="1" aria-label="Enrollment ID: activate to sort column descending" style="width: 211px;" aria-sort="ascending">Enrollment ID</th><th colname="Name" scope="col" class="sorting" tabindex="0" aria-controls="resultsGrid" rowspan="1" colspan="1" aria-label="Name: activate to sort column ascending" style="width: 99px;">Name</th><th colname="AddressLine1" scope="col" class="sorting" tabindex="0" aria-controls="resultsGrid" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 133px;">Address</th><th colname="City" scope="col" class="sorting" tabindex="0" aria-controls="resultsGrid" rowspan="1" colspan="1" aria-label="City: activate to sort column ascending" style="width: 69px;">City</th><th colname="State" scope="col" class="sorting" tabindex="0" aria-controls="resultsGrid" rowspan="1" colspan="1" aria-label="State: activate to sort column ascending" style="width: 89px;">State</th><th colname="ZipCode" scope="col" class="sorting" tabindex="0" aria-controls="resultsGrid" rowspan="1" colspan="1" aria-label="Zip: activate to sort column ascending" style="width: 59px;">Zip</th><th...
JavaScript
$(document).ready(function() {
$('#resultsGrid').DataTable( {
} );
$('#resultsGrid tbody').on('click', function() {
var row = $(this).parents('tr')[0];
//for row data
//console.log(table.row(row).data().id);
var data = $('resultsGrid').DataTable().row(this).data();
console.log(row);
console.log(data);
});
} );