I would like to change font for specific <th>
or <td>
elements.
The code:
table,
th,
td {
border: 3px solid white;
border-collapse: collapse;
}
th,
td {
padding: 10px;
}
body {
color: white;
background-color: black;
}
<table>
<tr>
<td>dummy</td>
<td>dummy</td>
<td>dummy</td>
<td>dummy</td>
</tr>
<tr>
<td>dummy</td>
<!--Part need to change style from this line-->
<td>dummy</td>
<td>dummy</td>
<td>dummy</td>
<!--to this line-->
</tr>
</table>
The comment part is to select the specific td then end select at the last comment.
2
Answers
You can use
tr:last-child td:not(:first-child)
selector to target the table cells (except the first one) in the last row:Hope, this helps. Use
nth-child
and learn how to use it as selector.