How can I hide empty html table cells with jQuery?

后端 未结 5 1250
别跟我提以往
别跟我提以往 2021-01-16 03:45

What I have to work with:
An html table 5X7. On many queries, there are less that 35 items filling the complete table.

How can I \"hide\" the empty cells dynam

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-16 03:54

    Obviously you'll want to adjust the selector to fit your specific needs:

    $('td').each(function(){
      if ($(this).html() == '') {
        $(this).hide();
      }
    });
    

提交回复
热议问题