You are being taught the HTML 4 way of doing things and it is now wrong
In the old specs the <tfoot> used to come before the <tbody>.
You can see at the official HTML standard repository that nearly 5 years ago the HTML spec was changed due to the fact that placing elements in the order suggested causes problems for accessibility. I have highlighted the key sentence as to why the <tfoot> should come after the <tbody>
Disallow <tfoot> before <tbody> in the content model
In HTML4, tfoot had to appear before tbody, but HTML5 allowed
either before or after. Placing it before causes problems for keyboard
focus order and order of accessibility objects, so this changes the
content model to no longer allow tfoot before tbody.
The reason for this is DOM order, one of the key elements of accessibility. By placing the <tfoot> before the <tbody> it will get read first, meaning when you reach the end of the table there is no <tfoot> element as would be expected.
Additionally you will find the following quote from the W3C HTML recommendation supports tfoot at the end.
Content model: 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.