how to remove entire table row containing empty TD cells with jquery |
how to remove entire table row containing empty TD cells with jquery |
shankar from vizag |
Oct 18 2019, 11:15 PM
Post
#1
|
Advanced Member Group: Members Posts: 202 Joined: 18-June 13 Member No.: 19,316 |
Greetings
a table contains empty cells. Can we delete the entire row containing the empty cells with Jquery ? example <table> <tr><td>Sl.No.</td><td>Name</td><td>Hobby</td></tr> <tr><td>1.</td><td>Edward</td><td>Music</td></tr> <tr><td>2.</td><td>Chris</td><td>Football</td></tr> <tr><td>3.</td><td>Edward</td><td></td></tr> </table> In the above table, 3rd row 3rd column is empty and I want to remove / hide entire 3rd row. I used the following jquery script. But its not working in my php page. <script> $('td').each(function(){ if($(this).is(:empty)){ $(this).closest('tr').hide(); } }); </script> Please suggest, how to do ? regards SHANKAR SB This post has been edited by shankar from vizag: Oct 18 2019, 11:54 PM |
Lo-Fi Version | Time is now: 25th April 2024 - 07:02 AM |