How do I select the cells in a table but not the cells of an embedded table? There is a question on how to do this in JQuery. I need to do this in 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>
Select cells To select a single cell, click inside a cell, or select text, and then choose Table > Select > Cell. To select multiple cells, drag across a cell border. Be careful not to drag the column or row line so that you don't resize the table.
Select the header or the first row of your list and press Shift + Ctrl + ↓(the drop down button), then the list has been selected except the first row.
To remove a table but keep data and formatting, go to the Design tab Tools group, and click Convert to Range. Or, right-click anywhere within the table, and select Table > Convert to Range.
Press F5 or CTRL+G to launch the Go To dialog. In the Go to list, click the name of the cell or range that you want to select, or type the cell reference in the Reference box, then press OK. For example, in the Reference box, type B3 to select that cell, or type B1:B3 to select a range of cells.
You can use >, the child selector.
Example:
table#Outer > tbody > tr > td { color: red; }
The child selector selects only direct descendents. More on the child selector: http://meyerweb.com/eric/articles/webrev/200006b.html. But it's not supported by every web browser: http://www.quirksmode.org/css/contents.html.
As given by a comment in the linked question:
table#Outer > tbody > tr > td { }
Note that because of cascading, changes will apply to the inner table as well unless you provide a default override style for all cells:
td { background-color: white; }
table#Outer > tbody > tr > td { background-color:red; }
http://jsfiddle.net/95NAd/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With