'Create HTML table, used for displaying peek'

def make_html_table(self, dataset, skipchars=[]):

    out = ['<table    cellspacing="0"    cellpadding="3">']
    try:
        with open(dataset.file_name, 'r') as f:
            d = f.readlines()[:5]
        if (len(d) == 0):
            out = ('Cannot    find    anything    to    parse    in    %s' % dataset.name)
            return out
        hasheader = 0
        try:
            [('%f' % x) for x in d[0][1:]]
        except:
            hasheader = 1
        out.append('<tr>')
        if hasheader:
            for (i, name) in enumerate(d[0].split()):
                out.append(('<th>%s.%s</th>' % ((i + 1), name)))
            d.pop(0)
            out.append('</tr>')
        for row in d:
            out.append('<tr>')
            out.append(''.join([('<td>%s</td>' % x) for x in row.split()]))
            out.append('</tr>')
        out.append('</table>')
        out = ''.join(out)
    except Exception as exc:
        out = ("Can't    create    peek    %s" % exc)
    return out
