jQuery DataTables AlphabetSearch: Bootstrap 3
Example for https://www.gyrocode.com/projects/jquery-datatables-alphabetical-search/
by ashleycam3ron
HTML
<link rel="stylesheet" href="https://cdn.datatables.net/v/bs-3.3.7/dt-1.10.15/datatables.min.css">
<script src="https://cdn.datatables.net/v/bs-3.3.7/dt-1.10.15/datatables.min.js"></script>
<link rel="stylesheet" href="https://gyrocode.github.io/jquery-datatables-alphabetSearch/1.2.7/css/dataTables.alphabetSearch.bootstrap.css">
<script src="https://gyrocode.github.io/jquery-datatables-alphabetSearch/1.2.7/js/dataTables.alphabetSearch.min.js"></script>
<div class="container-fluid">
<h3><a target="_blank" href="https://www.gyrocode.com/projects/jquery-datatables-alphabetsearch/">jQuery DataTables AlphabetSearch:</a> <a target="_blank" href="https://www.gyrocode.com/projects/jquery-datatables-alphabetsearch/examples/styling/bootstrap3/">Bootstrap 3</a></h3>
<table id="example" class="table table-bordered table-striped table-condensed" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<hr><a target="_blank" href="https://www.gyrocode.com/projects/jquery-datatables-alphabetical-search/">See full article on Gyrocode.com</a>
</div>
JavaScript
$(document).ready(function(){
var table = $('#example').DataTable({
ajax: 'https://gyrocode.github.io/files/jquery-datatables/arrays.json',
dom: "A<'row'<'col-sm-6'l><'col-sm-6'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
alphabetSearch: {
column: 0
},
drawCallback: function(){
$('.alphabet ul').addClass('pagination pagination-sm');
$('.alphabet .alphabet-info-display').addClass('form-control-static');
$('.alphabet a.active').closest('li').addClass('active');
}
});
});