BUG: to_html doesn't slice index to max_rows before formatting

@takluyver, missed an O(N) there.

#5588