I am able to create dataTable successfully
Here is Demo:https://jsfiddle.net/w2nevcca/3/
The problem occurs when i add
<tr>
<th class="widthind">14/11/2017</th>
</tr>
<!-- added as date divider -->
When i add above code as divider to show my date
Here is 2nd Demo(Not Working):https://jsfiddle.net/pkxmnh2a/12/
below is my code
HTML:
<div class="table-content table-responsive">
<table id="examples" class="display tvalues" cellspacing="0" width="100%" name="tabel">
<thead>
<tr>
<!--th>ID</th-->
<th>User Id</th>
<th>User Name</th>
<th>Project Name</th>
<th>Work Description</th>
<!--<th>Reported On</th>-->
</tr>
</thead>
<tfoot>
<tr>
<!--th>ID</th-->
<th>User Id</th>
<th>User Name</th>
<th>Project Name</th>
<th>Work Description</th>
<!-- <th>Reported On</th>-->
</tr>
</tfoot>
<tbody>
<tr>
<th class="widthind">14/11/2017</th>
</tr>
<tr>
<td>9cbc6e5a99bf96a61e5fa0445315286f</td>
<td>arjun</td>
<td>today's day report</td>
<td>
<p>this my first day report employeee 2222</p>
</td>
</tr>
<tr>
<td>9cbc6e5a99bf96a61e5fa0445315286f</td>
<td>arjun</td>
<td>today's day report</td>
<td>
<p>this my first day report employeee 33333</p>
</td>
</tr>
<tr>
<td>9cbc6e5a99bf96a61e5fa0445315286f</td>
<td>arjun</td>
<td>today's day report</td>
<td>
<p>this my first day report employeee 44444</p>
</td>
</tr>
<tr>
<th class="widthind">13/11/2017</th>
</tr>
<tr>
<td>9cbc6e5a99bf96a61e5fa0445315286f</td>
<td>arjun</td>
<td>yesterday report</td>
<td>
<p>this my yesterday day report employeee 2222</p>
</td>
</tr>
<tr>
<td>9cbc6e5a99bf96a61e5fa0445315286f</td>
<td>arjun</td>
<td>yesterday report</td>
<td>
<p>this my yesterday day report employeee 33333</p>
</td>
</tr>
</tbody>
</table>
</div>
below is my javascript code
JS:
$(document).ready(function () {
var table = $('#examples').DataTable();
$('a.toggle-vis').on('click', function (e) {
e.preventDefault();
var column = table.column($(this).attr('data-column'));
column.visible(!column.visible());
});
$('#examples tfoot th').each(function () {
var title = $('#examples thead th').eq($(this).index()).text();
$(this).html('<input tyepe="text" placeholder="Search ' + title + '"/>');
});
table.columns().eq(0).each(function (colIdx) {
$('input', table.column(colIdx).footer()).on('keyup change', function () {
table
.column(colIdx)
.search(this.value)
.draw();
});
});
});
The above code works perfectly when i don't add divider to dive the date
when i add the divider the above code doesn't work.
Please help me thanks in advance !!!!