DataTables

DataTables Examples

HTML

<link rel="stylesheet" href="//cdn.datatables.net/1.10.0/css/jquery.dataTables.css">
<script src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>
<table cellpadding="0" cellspacing="0" border="0" class="row-border" id="table">
<thead>
    <th>Video ID</th>
    <th>Filename</th>
    <th>Action</th>
</thead>
<tbody>
    <tr>
    <td>1</td>
    <td>ABCD</td>
        <td><input type='button' id='deleteBtn' value='Delete' /></td>
    </tr>
</tbody>
<tfoot>
    <tr>
        <th>Video ID</th>
        <th>Filename</th>
        <th>Action</th>
    </tr>
</tfoot>
</table>

JavaScript

//datatable creation is in another file
$('#table').dataTable( {} )



$("button.deleteBtn").click(function(){
  var row = $(this).closest("tr");
  var table = row.closest('table').dataTable();
  table.api()
    .row( row )
    .remove()
    .draw();
})