如果其中一列为空则隐藏行
我有一个包含几行的表,每行有两列,左第一列是标题或主题,右列是它们的值。如果右列为空,我需要隐藏相应的行,即整行本身和标题。在jquery中如何实现呢?
<table cellpadding="10" class ="EventDetail">
<tr>
<td class="TableFields">Who Should Enroll?:</td>
<td>Everyone 18 and older who would like to attend</td>
</tr>
<tr>
<td class="TableFields">Handicapped Access:</td>
<td>Yes</td>
</tr>
<tr>
<td class="TableFields">Parking Notes:</td>
<td></td>
</tr>
<tr>
<td class="TableFields">Instructor:</td>
<td>John Filler</td>
</tr>
</table>
I have a table with a couple of rows each row with two columns, first left column is the title or topic and the right column is their value. If the right column is empty i need to hide the corresponding row, the whole row itself with the title . How to do it in jquery?
<table cellpadding="10" class ="EventDetail">
<tr>
<td class="TableFields">Who Should Enroll?:</td>
<td>Everyone 18 and older who would like to attend</td>
</tr>
<tr>
<td class="TableFields">Handicapped Access:</td>
<td>Yes</td>
</tr>
<tr>
<td class="TableFields">Parking Notes:</td>
<td></td>
</tr>
<tr>
<td class="TableFields">Instructor:</td>
<td>John Filler</td>
</tr>
</table>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试此
工作演示
替代解决方案
工作演示
Try this
Working demo
Alternative solution
Working demo