I found a CSS tutorial to style a table, but on my page there are other tables. So I cannot figure out how to use a selector here. tr:nth-of-type(odd) is the selector. But I want this to be used only on a table which has an id or class named playerslist.
<table id="playerslist">
<thead>
<tr>
<th>Player Name</th>
<th>Player #</th>
<th>Team</th>
</tr>
</thead>
<tbody>
<tr>
<td>Simon</td>
<td>25</td>
<td>Team A</td>
</tr>
<tr>
<td>Richard</td>
<td>5</td>
<td>Team B</td>
</tr>
</tbody>
</table>
Any ideas how to target tr:nth-of-type(odd), th and td elements of a table with an id of playerslist?
Thank you
Specify your table’s class or id in your style definition: