In [1]:
h = ['a', 'b', 'c', 'd']
In [12]:
table = '<table>'
for i in h:
table += '<th>{}</th>'.format(i)
table += '</table>'
table
Out[12]:
In [7]:
import numpy as np
import pandas as pd
df = pd.DataFrame(np.arange(12.).reshape((3,4)))
df
Out[7]:
In [8]:
from IPython.display import display, HTML
display(df)
In [9]:
HTML(df.to_html())
Out[9]:
In [10]:
df.to_html()
Out[10]:
In [13]:
HTML(table)
Out[13]: