我用下面的代碼: 這是HTML表格:JQuery的隱藏功能適用於日而不是TD
<table id="preTbl">
<tr>
<th>Type</th>
<th>Origin</th>
<th>Count</th>
<th>Age Range</th>
<th>Gender</th>
</tr>
<tr ng-repeat="row in returnData" class="centered">
<td>{{ row.TypeName }}</td>
<td>{{ row.Origin }}</td>
<td>{{ row.Count }}</td>
<td>{{ row.ageRange}}</td>
<td>{{ row.gender}}</td>
</tr>
</table>
我與用戶JS功能點擊搜索:
$("#preTbl th:nth-child(4)").hide();
$("#preTbl td:nth-child(4)").hide();
的日隱藏得很好,但td不會隱藏。
請添加更多相關代碼。 –
td是不是隱藏的元素的子元素嗎?或者它是直接的孩子? –
請顯示html – Brian