BUG: Fix user-facing AssertionError with to_html (#25608)
State: closed

- [x] closes #25608
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I did not use an oxford comma in the error description, which is how it was written in the issue's expected result.

Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=h1) Report
> Merging [#25620](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/976a2db444c20ee71895bda394193aa24e1e5734?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/25620/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #25620      +/-   ##
==========================================
+ Coverage   91.26%   91.26%   +<.01%     
==========================================
  Files         173      173              
  Lines       52968    52969       +1     
==========================================
+ Hits        48339    48340       +1     
  Misses       4629     4629
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.83% <100%> (ø)` | :arrow_up: |
| #single | `41.71% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/25620/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `99.35% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=footer). Last update [976a2db...d7165ef](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=h1) Report
> Merging [#25620](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/976a2db444c20ee71895bda394193aa24e1e5734?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/25620/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #25620      +/-   ##
==========================================
+ Coverage   91.26%   91.26%   +<.01%     
==========================================
  Files         173      173              
  Lines       52968    52969       +1     
==========================================
+ Hits        48339    48340       +1     
  Misses       4629     4629
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.83% <100%> (ø)` | :arrow_up: |
| #single | `41.71% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/25620/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `99.35% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=footer). Last update [976a2db...4739965](https://codecov.io/gh/pandas-dev/pandas/pull/25620?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks @ArtificialQualia