BUG: fix nbsp for html formatting
- [x] closes #59876
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Fixes:
- Modified :class:HTMLFormatter._write_cell to escape regular spaces as &nbsp;, ensuring multiple spaces are preserved in the HTML output.

Hi @mroeschke, Since the this issue is related to the float formatting, I included the test cases for `nbsp` in the same test function. Request you to please review. Thanks!  Thanks @saldanhad 