QST: What is the use of cell_context in the Styler?
- [X] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.

- [ ] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).

---

#### Question about pandas

**Note**: If you'd still like to submit a question, please read [this guide](
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your question.

In pandas/io/formats/style.py (https://github.com/pandas-dev/pandas/blob/3ef3617c2e784b98db83ab437e7607459f68a1cc/pandas/io/formats/style.py#L265) the cell_context dict is created (empty).  It is referenced twice (on line 318 and 382), where values are accessed, if they are present.  The dict is however never updated.

What is the use of this variable?  It seems to me to be quite useless as there is no way to set it's content.  Is it purely there for future use?  I use v0.23 where it was already like this, so I expected it to have changed in master, but this doesn't seem to be the case.  Is there some way of setting it that I'm not aware of?

There are a few stack overflow questions (https://stackoverflow.com/questions/55236631/add-custom-css-class-to-column-or-cell-of-a-dataframe and https://stackoverflow.com/questions/62075616/add-style-class-to-pandas-dataframe-html) )by others,s not me) that ask how to set the class of a cell.  These seem related to how this dict's values could be set.  To "implement" support for classes, I simply overwrote the render method to call _translate and then to adjust the d["body']'s content where I added to the cell's class value.  If cell_context could be set, then there would be no need to do this overriding after the fact (and actually benefit from the looking that is performed against cell_context)...   (I would like to respond to these two questions, possibly with my monkey-patching, but preferably with what happens in _translate()).

Thanks,
Grant

