class DictTable(dict):

    def _repr_html_(self):
        html = ['<table width=100%>']
for key, value in self.items():
    html.append('<tr>')
html.append('<td>{0}</td>'.format(key))
html.append('<td>{0}</td>'.format(value))
html.append('</tr>')
html.append('</table>')
return ''.join(html)
Python dictionary as html table in ipython notebook