'Get the foster parent element, and sibling to insert before
(or None) when inserting a misnested table node'

def getTableMisnestedNodePosition(self):

    lastTable = None
    fosterParent = None
    insertBefore = None
    for elm in self.openElements[::(-1)]:
        if (elm.name == u'table'):
            lastTable = elm
            break
    if lastTable:
        if lastTable.parent:
            fosterParent = lastTable.parent
            insertBefore = lastTable
        else:
            fosterParent = self.openElements[(self.openElements.index(lastTable) - 1)]
    else:
        fosterParent = self.openElements[0]
    return (fosterParent, insertBefore)
