You should append to employeesTable only the thead and tbody element, then append to thead and tbody the table rows you need, and finally append to each row the cells.
To do it, just assign to a variable the elements you are creating and you will need to append some element to. Then, append to those variables instead of employeesTable