@staticmethod
def fix_table_p(tree):
    """
        Force "tabular" tables to not have <p> as top-level within <td>.
        Those <p> mess up table spacing.
        """
    for table in tree.findall('.//table[@class="tabular"]'):
        for td in table.findall('.//td'):
            if not len(td):
                continue
            tdtop = td[0]
            if tdtop.tag == 'p':
                for elem in tdtop:
                    tdtop.addprevious(elem)
            td.text = (td.text or '') + tdtop.text
            td.remove(tdtop)
