I do have a table of 5 columns.i want to collapse last three columns of the table on click of a image and again reappear on click of other image.I have written some code but its not working so please guide me on this:
<img id="hide" src="assets/img/decrease_indent.png" />
<img id="show" src="assets/img/increase_indent.png" />
<thead>
<tr>
<th class="">Name</th>
<th class=""></th>
<th class="">Dur</th>
<th class="">Start</th>
<th class=""></th>
</tr>
</thead>
<tbody data-bind="foreach:items">
<tr data-bind="value:id">
<td data-bind="text:"></td>
<td></td>
<td data-bind="text:"></td>
<td data-bind="text:"></td>
<td data-bind="text:"></td>
</tr>
</tbody>
<script type="text/javascript">
$(function(){
$("#hide").live('click',function(){
$("th:eq(2),th:eq(3),th:eq(4)td:eq(2),td:eq(3),td:eq(4)").hide();
});
$("#show").live('click',function(){
$("th:eq(2),th:eq(3),th:eq(4)td:eq(2),td:eq(3),td:eq(4)").show();
});
});
</script>