added functions createtrelement and createtdelement