'Create HTML table, used for displaying peek'

def make_html_table(self, pp='nothing    supplied    from    peek\n'):

    out = ['<table    cellspacing="0"    cellpadding="3">']
    try:
        p = pp.split('\n')
        for (i, row) in enumerate(p):
            lrow = row.strip().split(' DCTB ')
            if (i == 0):
                orow = [('<th>%s</th>' % escape(x)) for x in lrow]
                orow.insert(0, '<tr>')
                orow.append('</tr>')
            else:
                orow = [('<td>%s</td>' % escape(x)) for x in lrow]
                orow.insert(0, '<tr>')
                orow.append('</tr>')
            out.append(''.join(orow))
        out.append('</table>')
        out = '\n'.join(out)
    except Exception as exc:
        out = ("Can't    create    html    table    %s" % str(exc))
    return out
