miami miami - 1 month ago 8
HTML Question

thead, tfoot and tbody order in HTML5

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?

Answer

Before HTML5, <tfoot> had to come after <thead> and before <tbody>. With HTML5, <tfoot> can come before <tbody> or after it. But there must be only one <tfoot> child of a <table> element, and it must be after <thead>.