내 테이블 스트라이핑에서 중첩 테이블을 제외하려고합니다. 다른 모든 행은 다른 bg 컬러로 만듭니다.jQuery로 표 스트라이핑에서 중첩 테이블 제외
$(".stripeTable tbody tr:odd").addClass("stripe");
, 어떻게 클래스 "스트라이프"를받는 중첩 테이블의 홀수 행을 방지하는 것입니다 내 질문 : 여기에 테이블을 스트라이프 내 코드는?
브라우저에서 생성 된 코드는 다음과 같습니다. 중첩 테이블에서 class = "stripe"를 제거하려고합니다. 중첩 된 테이블뿐만 아니라 stripeTable
클래스가있는 경우, 당신은 .stripeTable
을 고정해야 할 수도 있습니다
$(".stripeTable > tbody > tr:odd").addClass("stripe");
: 만 최상위 표는 stripeTable
클래스가있는 경우, 그냥 자식 선택자 >
추가
<table>
<tr>
<td>My Table Cell </td>
</tr>
<tr class="stripe">
<td>
<table>
<tr>
<td>My nested table cell</td>
</tr>
<tr class="stripe">
<td>my nested table cell (remove the stripe!)</td>
</tr>
</table>
</td>
</tr>
</table>
'stripeTable' 클래스는 어디에 있습니까? – BoltClock