Fixes #8785 - HTML syntax fixes - add thead/tbody, fix formatting