"Bootstrap Snippet for Datatable"
Bootstrap 3.3.0 Snippet by xrozix

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script> <div class="container"> <div class="row"> <div class="col-md-12"> <h4>Bootstrap Snipp for Datatable</h4> <div class="table-responsive"> <table id="mytable" class="table table-bordred table-striped"> <thead> <th>Student Name</th> <th>Group name</th> <th>Subject</th> <th>Assignment</th> <th>Grade</th> <th>Download</th> </thead> <tbody> <tr> <td>luffy</td> <td>Monkey</td> <td>java</td> <td>form submit</td> <td><p data-placement="top" data-toggle="tooltip" title="Edit"><button class="btn btn-primary btn-md" data-title="Edit" data-toggle="modal" data-target="#edit" ><span class="glyphicon glyphicon-pencil"></span></button></p></td> <td><p data-placement="top" data-toggle="tooltip" title="Download"><span class="btn btn-default btn-md"><i class="glyphicon glyphicon-download-alt"></span></button></p></td> </tr> <tr> <td>luffy</td> <td>Monkey</td> <td>java</td> <td>form submit</td> <td><p data-placement="top" data-toggle="tooltip" title="Edit"><button class="btn btn-primary btn-md" data-title="Edit" data-toggle="modal" data-target="#edit" ><span class="glyphicon glyphicon-pencil"></span></button></p></td> <td><p data-placement="top" data-toggle="tooltip" title="Download"><span class="btn btn-default btn-md"><i class="glyphicon glyphicon-download-alt"></span></button></p></td> </tr> <tr> <td>luffy</td> <td>Monkey</td> <td>java</td> <td>form submit</td> <td><p data-placement="top" data-toggle="tooltip" title="Edit"><button class="btn btn-primary btn-md" data-title="Edit" data-toggle="modal" data-target="#edit" ><span class="glyphicon glyphicon-pencil"></span></button></p></td> <td><p data-placement="top" data-toggle="tooltip" title="Download"><span class="btn btn-default btn-md"><i class="glyphicon glyphicon-download-alt"></span></button></p></td> </tr> <tr> <td>luffy</td> <td>Monkey</td> <td>java</td> <td>form submit</td> <td><p data-placement="top" data-toggle="tooltip" title="Edit"><button class="btn btn-primary btn-md" data-title="Edit" data-toggle="modal" data-target="#edit" ><span class="glyphicon glyphicon-pencil"></span></button></p></td> <td><p data-placement="top" data-toggle="tooltip" title="Download"><span class="btn btn-default btn-md"><i class="glyphicon glyphicon-download-alt"></span></button></p></td> </tr> <tr> <td>luffy</td> <td>Monkey</td> <td>java</td> <td>form submit</td> <td><p data-placement="top" data-toggle="tooltip" title="Edit"><button class="btn btn-primary btn-md" data-title="Edit" data-toggle="modal" data-target="#edit" ><span class="glyphicon glyphicon-pencil"></span></button></p></td> <td><p data-placement="top" data-toggle="tooltip" title="Download"><span class="btn btn-default btn-md"><i class="glyphicon glyphicon-download-alt"></span></button></p></td> </tr> </tbody> </table> <div class="clearfix"></div> <ul class="pagination pull-right"> <li class="disabled"><a href="#"><span class="glyphicon glyphicon-chevron-left"></span></a></li> <li class="active"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#"><span class="glyphicon glyphicon-chevron-right"></span></a></li> </ul> </div> </div> </div> </div> <div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button> <h4 class="modal-title custom_align" id="Heading">Grade & Message</h4> </div> <div class="modal-body"> <div class="form-group"> <input class="form-control " type="text" placeholder="Grade"> </div> <div class="form-group"> <textarea rows="2" class="form-control" placeholder="Message"></textarea> </div> </div> <div class="modal-footer "> <button type="button" class="btn btn-warning btn-lg" style="width: 100%;"><span class="glyphicon glyphicon-ok-sign"></span> Update</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div>
$(document).ready(function(){ $("#mytable #checkall").click(function () { if ($("#mytable #checkall").is(':checked')) { $("#mytable input[type=checkbox]").each(function () { $(this).prop("checked", true); }); } else { $("#mytable input[type=checkbox]").each(function () { $(this).prop("checked", false); }); } }); $("[data-toggle=tooltip]").tooltip(); });

Related: See More


Questions / Comments: