def insertElementTable(self, token):
element = self.createElement(token)<EOL>if self.openElements[-<NUM_LIT:1>].name not in tableInsertModeElements:<EOL><INDENT>return self.insertElementNormal(token)<EOL><DEDENT>else:<EOL><INDENT>parent, insertBefore = self.getTableMisnestedNodePosition()<EOL>if insertBefore is None:<EOL><INDENT>parent.appendChild(element)<EOL><DEDENT>else:<EOL><INDENT>parent.insertBefore(element, insertBefore)<EOL><DEDENT>self.openElements.append(element)<EOL><DEDENT>return element<EOL>
Create an element and insert it into the tree