Style the last line of a type with CSS
I have a question. I have a table similar to the table below
<table>
<tbody>
<tr class="unread"><td>Message</td></tr>
<tr class="unread"><td>Message</td></tr>
<tr class="unread"><td>Message</td></tr>
<tr class="read"><td>Message</td></tr>
<tr class="read"><td>Message</td></tr>
<tr class="read"><td>Message</td></tr>
<tr class="read"><td>Message</td></tr>
</tbody>
</table>
I'm trying to add border-bottom
to last .unread
using tr.unread:last-of-type
, but doesn't seem to work.
I am looking for a pure CSS solution as the number of unread / read lines is dynamically changing and has no code access.
+3
source to share