如何选择表格中的单元格而不选择嵌入式表格的单元格?关于如何在JQuery中执行此操作存在一个问题.我需要在CSS中执行此操作.
<table id="Outer">
<tr>
<td> --this one
</td>
<td> --this one
<table>
<tr>
<td></td> -- but not this one or any deeper nested cells
</tr>
</table>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
Kat*_*ieK 13
您可以使用>,子选择器.
例:
table#Outer > tbody > tr > td { color: red; }
Run Code Online (Sandbox Code Playgroud)
子选择器仅选择直接后代.有关子选择器的更多信息:http://meyerweb.com/eric/articles/webrev/200006b.html.但是每个网络浏览器都不支持它:http://www.quirksmode.org/css/contents.html.