を隠す:なしTRであれば、私はこのテーブルを出力していますテーブル
を:私はしないようにテーブル全体を必要とする<table class="table-example">
<thead>
<tr>
<th scope="col">Location</th>
<th scope="col">Description</th>
<th scope="col">Status</th>
<th scope="col">Eta Fix</th>
</tr>
</thead>
<tbody></tbody>
</table>
上でこの上のバリエーションを使用してみましたとのtbodyが空の場合に表示
$(function(){
if ($('.table-example > tbody').length == 0){
$('.table-example).hide();
}
});
私は間違っていますか?
とともに
:has
セレクタやメソッドを使用することができますtr要素の代わりに.table-exampleの内部にあります。セレクタを ".table-example> tbody tr"に変更してください – SidTheBeard