BUG: output formatting with to_html(), index=False and/or index_names=False (#22579, #22747)
- [x] closes #22579
- [x] closes #22747
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
