Basic problem is
<thead> tags inside the first loop. Ditto
<tbody> tag inside the second loop. And missing
The "heading" HTML should look something like this:
There's a great tool to validate your HTML that could help you track down problems like this. It was included in the 2015 pset spec, but I do not see it mentioned in the current version.
Be sure, incidentally, that any HTML generated by register.php is valid, as by ctrl- or right-clicking on the page in Chrome, selecting View Page Source, highlighting and copying the source code, and then pasting it into the W3C’s validator at http://validator.w3.org/#validate_by_input and then clicking Check. Ultimately, the Result of checking your page for validity via the W3C’s validator should be Passed or Tentatively passed, in which case you should see a friendly green banner. Warnings are okay. Errors (and big red banners) are not. Note that you won’t be able to "validate by URI" at http://validator.w3.org/#validate_by_uri, since your workspace isn’t accessible on the public Internet!
FWIW here is the MDN Doc on