illustrates the way nth-of-type selector works

by hrabinowitz

HTML

<table>
	<thead>
    	<tr>
        	<th>Head 1</th>
            <th>Head 2</th>
        </tr>
        <tr>
        	<th>Head 1a</th>
            <th>Head 2a</th>
        </tr>
    </thead>
    <tbody>
    	<tr>
        	<td>item 1</td>
            <td>item 2</td>
        </tr>
        <tr>
        	<td>item 1 row 2</td>
            <td>item 1 row 2</td>
        </tr>
    </tbody>
</table>

CSS

table tr:nth-of-type(1) {
	color: red;
}
table {
    border-collapse: collapse;
}
table, th, td {
	border: 1px dotted black;
}