HTML
<hr />
<h1>Table-1</h1>
<hr />
<table class="tb1">
<tr>
<td>rw1</td>
<td>rw1</td>
<td>rw1</td>
</tr>
<tr>
<td>rw1</td>
<td>rw1</td>
<td>rw1</td>
</tr>
<tr>
<td colspan="3">
<table class="tb2">
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>rw1</td>
<td>rw1</td>
<td>rw1</td>
</tr>
<tr>
<td colspan="3">
<table class="tb2">
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
</table>
</td>
</tr>
</table>
<hr />
<h1>Table-2</h1>
<hr />
<table class="tb1">
<tr>
<td>rw1</td>
<td>rw1</td>
<td>rw1</td>
</tr>
<tr>
<td>rw1</td>
<td>rw1</td>
<td>rw1</td>
</tr>
<tr>
<td colspan="3">
<table class="tb2">
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>rw1</td>
<td>rw1</td>
<td>rw1</td>
</tr>
<tr>
<td colspan="3">
<table class="tb2">
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
<tr>
<td>tbrw2</td>
<td>tbrw2</td>
<td>tbrw2</td>
</tr>
</table>
</td>
</tr>
</table>
CSS
.tb1{
border-collapse:collapse;
}
.tb1 tr td {
border-bottom:1px solid #ccc;
text-align:center;
padding:10px;
}
.tb2{
border-collapse:collapse;
}
.tb2 tr td {
border-bottom:1px solid #f00;
text-align:center;
padding:10px;
}
查询
$(".tb1 tr:last-child td,.tb2 tr:last-child td").css("border","none");
有很多如下图所示的表格,并使用 jquery 更改了一些边框(我知道一点 jquery),但是关于边框有一些问题。Jquery 在最后一个 tr 中更改所有 td 的边框。我对选择器有误。我怎样才能解决这个问题?
JSfiddle