I have a table like this:
<table Id="modules-mgr">
<tbody>
<tr>
<td>lorem ispium blok</td>
<td>lorem ispium blok</td>
<td>lorem ispium blok</td>
</tr>
<tr>
<td>lorem ispium blok</td>
<td>lorem ispium blok</td>
<td>lorem ispium blok</td>
</tr>
<tr>
<td>lorem ispium blok</td>
<td>lorem ispium blok</td>
<td>lorem ispium blok</td>
</tr>
</tbody>
</table>
I want to hide last td from every tr.
there is not any class for the td and tr, so we need to select them using .eq.
And also want a else if function, like resize event. if windows resize to 200 then hide last td, if window resize to 100 hide last two td.
here what i have done so far, but dint worked;
jQuery(window).resize(function() {
var width=jQuery(window).width();
if(width < 870) {
jQuery('table#modules-mgr tr td').eq(10).hide()
}
/*elseif(width < 570) {
}
else {
}*/
});
CSS only: