I'm trying to select the 5% tr
, but my css selector does not seem to work. I also have to write one for the 10% tr
, which I expect will be simple after the 5% tr
is solved. My selector seems to work down to table
, but I cannot get it to select the second tr
. What am I doing wrong?
Code:
body > form > div > table > tr:nth-child(2) > td:first-child {
background-color: red
}
<form method="post">
<div>
<table cellpadding="0" align="center" cellspacing="0" border="0">
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td style="width: 5%">
5%
</td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="height: 100%; border-color: #e0e0e0;">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td width="10%" valign="top" style="height: 100%;">10%</td>
<td valign="top" width="90%">
My Content
</td>
</tr>
</table>
</tr>
</table>
</div>
</form>