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?
Thats a great question. I cannot find a direct answer to why it works only when border-collapse is set to collapse. My hunch is that a table element would be a box in itself and then the td (table data) and tr (table row) would creat boxes within this. Each would have its own border. The table having a bigger outer border while the td and tr their own.
I noticed taht I cpoould target just the top and bottom borders of of the tfoot with the followin code
However if we were to have a border top for the table it would be right at the top. I can only demonstrate how it works but not the reason behind it. As I said I think a table, td and tr act like boxes within boxes.