-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CSS selector for index cells #28204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you go through the history and see when / why it was changed? |
I went through all the changelogs from 0.21 to 0.25.1 but didn't find any mention of it. |
I can confirm that the behaviour for repr_html is incorrect. I think this is due to the default for bold_rows being False for DataFrameFormatter while the default being True for to_html. will do some tests tomorrow but may be caused by #27991 |
Great! Thank you! |
…dev#28216) * REGR: <th> tags for notebook display closes pandas-dev#28204
…dev#28216) * REGR: <th> tags for notebook display closes pandas-dev#28204
…dev#28216) * REGR: <th> tags for notebook display closes pandas-dev#28204
While using Jupyter notebooks, I like to change the color of header cells in Pandas dataframes (all index cells, up and left) for more contrast between the indexes and the data itself (especially when I'm dealing with multiple indexes after using
.groupby()
like in the picture below) :I used to achieve this using this CSS code :
This worked because every index cell (in all indexes, up and left) used to be represented by a
<th> </th>
HTML tag.However, after updating to Pandas version
0.25.1
from version0.21.x
, the CSS stopped working because the HTML changed so only the upper index cells (column names) are wrapped in<th> <th>
tags. The left index simply uses<td> </td>
tags, just like the data cells (See image below. Note that both Genre and MediaTypeId are indexes):Was this intentional? I tried using
first-child
like below but it only worked with dataframes having only 2 indexes (up and left). For the dataframes with more than one index on the left, only the first index is affected :Any ideas?
The text was updated successfully, but these errors were encountered: