I was reading in a forum about <tfoot>
element that it must come after <thead>
element. In contrast I saw some people use the order <thead><tbody><tfoot>
. So what is the correct and best to follow order?
According to the W3 specs, tfoot
has to come before tbody
. (Links to specs here -> Why do internal TABLE sections have to go THEAD TFOOT TBODY to validate?)
This was done to allow the header and footer of a table to load first, before loading in a variable amount of body data, which would otherwise possibly block the loading of the table footer.
In the HTML 5.1 spec, <tfoot>
can only come after <tbody>
.
In this order: optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, followed by either zero or more tbody elements or one or more tr elements, followed optionally by a tfoot element, optionally intermixed with one or more script-supporting elements.
https://www.w3.org/TR/html51/tabular-data.html#tabular-data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With