to_html function fail when max_rows is specified
The error is:
list index out of range
Exception Location: /home/pietro/lod4statenv/local/lib/python2.7/site-packages/pandas/core/format.py in _write_body, line 923

In order to fix it I have replaced line 922 from:

for i in range(len(self.frame)):

to:

for i in range(min(len(self.frame), self.max_rows)):
