Adds error messages

- Throws an error if the elements are not in a td or tr in a table