BUG: TypeError with to_html(sparsify=False) and max_cols < len(columns)
- [x] closes #22887
- [x] closes #11060
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
