I have the following table
<table>
<tr>
<td>1st</td>
<td>Anne Wright & Steve Wright</td>
<td>510 VPs</td>
</tr>
<tr>
<td>2nd</td>
<td>Ian Bruce & Lyn Hilton</td>
<td>472 VPs</td>
</tr>
<tr>
<td>3rd</td>
<td>Anne Morris & Lucy Pathan</td>
<td>469 VPs</td>
</tr>
<tr>
<td>4th</td>
<td>Mike Ayers & Mike Gould</td>
<td>426 VPs</td>
</tr>
<tr>
<td>5th</td>
<td>Alison Nichols & Simon Stokes</td>
<td>409 VPs</td>
</tr>
<tr>
<td>6th</td>
<td>Brian Stockdale & Sheila Stockdale</td>
<td>406 VPs</td>
</tr>
<tr class="relegated">
<td>7th</td>
<td>Pauline Dignan & Val Rees</td>
<td>349 VPs</td>
</tr>
<tr class="relegated">
<td>8th</td>
<td>Alan Lord & John Thompson</td>
<td>319 VPs</td>
</tr>
</table>
I want to put a red border above the row that has the class "relegated".
I know that I need to apply the border on the child <td>
tags and not the <tr>
I have tried
.relegated:nth-child(1) td {
border-top: 1px dashed red;
}
but I get nothing. Doing
tr:nth-child(7) td {
border-top: 1px dashed red;
}
does work. But I want to target it based on the class (because this is a league table and you can't get relegated from the bottom division).