1

I need to add a bottom border to the last <tr> element with class .pos from this table:

<table class="table table-borderless pos-table">
    <thead>
        <tr>
            <th class="nowrap">Pos</th>
            <th class="nowrap">Artikelnummer</th>
            <th class="nowrap">Menge</th>
            <th class="nowrap">VK-Preis</th>
            <th class="nowrap">Rabatt %</th>
            <th class="nowrap">Preis</th>
            <th class="nowrap">Gesamt</th>
        </tr>
    </thead>
    <tbody>
        <tr class="pos"></tr>
        <tr class="pos"></tr>
        <tr class="pos"></tr>
        <tr class="pos"></tr>
        <tr class="pos"></tr>
        <tr class="pos"></tr>
        <tr class="pos"></tr>
        <tr class="total"></tr>
    </tbody>
</table>

However I don't get it working with :last-child. I tried the following rules but none of them seems to be working:

.pos-table tbody tr.pos:last-child { border-bottom: 1px solid gray; }
.pos-table tr.pos:last-child { border-bottom: 1px solid gray; }
tr.pos:last-child { border-bottom: 1px solid gray; }

Does anyone know what I am doing wrong here?

Marvin Klein
  • 1,436
  • 10
  • 33
  • This appears to be something of a possible duplicate, does this answer your question: https://stackoverflow.com/questions/7687597/using-last-child-with-class-selector – David Thomas May 04 '21 at 09:16

0 Answers0