It is worth noting that space can be reduced by folding the table borders:
table { border-collapse: collapse; }
You can do something similar to what Jukka K. Korpela offers, and install a complement for all elements except the last child tr
, using the combination :not()
/ :last-child
pseudo :last-child
classes.
EXAMPLE HERE
tr:not(:last-child) td { padding-top: 1em; }
The above example works on your instance, however the target element may not be the last element. Therefore, you can use the pseudo-class for :nth-child()
to specify the desired item.
EXAMPLE HERE
tr td { padding-top: 1em; } tr:nth-child(4) td { padding-top: 0; }
As you can see, this approach works when you have more elements:
source share