%%file tmp.txt column 0 | column 1 | column2 ------------- |---------------| --------- abc | 1 | 1 def | 2 | 4 ghi | 3 | 9 f=open('tmp.txt') text=f.read() print text import markdown html=markdown.markdown(text, ['tables']) from IPython.core.display import HTML HTML(html) x=np.arange(0,360,5) y=np.cos(x/180.0*np.pi) plt.plot(x,y) text="No. | "+r"$\theta$"+"(degree) | "+r"$\cos \theta$"+"\n" text+="-|-|- \n" for i,(_x,_y) in enumerate(zip(x,y)): text+=str(i)+"|"+str(_x)+"|"+str(_y)+" \n" html=markdown.markdown(text, ['tables']) HTML(html) %%file tmp.txt No. θ  (degree) cosθ  0 0 1 1 5 0.9961946981 2 10 0.984807753 3 15 0.9659258263 4 20 0.9396926208 5 25 0.906307787 data=np.loadtxt('tmp.txt',skiprows=1, delimiter='\t') data