tfoot v last-of-type
by Troy Johnson
HTML
<p>Jimmy, the question was, “Which of the following <strong>CSS3 pseudo-elements</strong> could be used to apply styles to the last row of a table”</p>
<p>The code you provde does accomplish the task (there is always more than one way to do something with HTML), but <strong>tfoot</strong>, is not a CSS3 pseudo-element.<a href="http://www.w3schools.com/CSS/CSS_pseudo_elements.asp">reference my favorite site</a></p>
<p>tfoot is an HTML tag</p>
<table border="1">
<tr>
<td>ID</td>
<td>First Name</td>
<td>Last Name</td>
</tr>
<tr>
<td>0</td>
<td>Bill</td>
<td>Gates</td>
</tr>
<tr>
<td>1</td>
<td>Steve</td>
<td>Jobs</td>
</tr>
<tr>
<td>2</td>
<td>Steve</td>
<td>Gates</td>
</tr>
</table>
<p>4th paragraph</p>
<p>5th paragraph</p>
<p>6th paragraph (Last Paragraph)</p>
<table border="1">
<tr>
<td>ID</td>
<td>First Name</td>
<td>Last Name</td>
</tr>
<tr>
<td>0</td>
<td>Bill</td>
<td>Gates</td>
</tr>
<tr>
<td>1</td>
<td>Steve</td>
<td>Jobs</td>
</tr>
<tfoot>
<tr>
<td>2</td>
<td>Steve</td>
<td>Gates</td>
</tr>
</tfoot>
</table>
CSS
tfoot {
background-color: #00CCFF;
color: #FFFFFF;
text-align: center;}
p:last-of-type {
background: #00CCFF;
}
tr:last-of-type {
background: #00CCFF;
}