formatting table and closing tags