Challenge: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Tables_tasks#task
Solution
table {
border-top: 1.5px solid #eee;
border-bottom: 1.5px solid #eee;
}
table tfoot{
border-top: 1.5px solid #eee;
}
tr th:nth-child(n),td:nth-child(n) {
text-align: left;
}
tr th:nth-child(3),td:nth-child(3) {
text-align: right;
}
tbody tr:nth-child(2n-1) {
background-color: #eee;
}
With the above solution why does applied border on “tfoot” element does not work. It works if I apply the following on the “table” element. Any reason why?
table-collapse: collapse;
Thanks,