pandas icon indicating copy to clipboard operation
pandas copied to clipboard

DOC: Sticky Headers in Table Visualization is broken in v1.5.0

Open tehunter opened this issue 3 years ago • 6 comments
trafficstars

Pandas version checks

  • [X] I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/pandas-docs/version/1.5.0/user_guide/style.html#Sticky-Headers

Documentation problem

Here is how the DataFrame looks in v1.5.0 documentation: image

Here is how it looked in v1.4.4 documentation: image

I'm using Firefox 104

Suggested fix for documentation

It seems that pydata-sphinx-theme.css is applying width: fit-content; to all tables. This should be overridden for this wide table.

This seems to be related to #48285

tehunter avatar Sep 19 '22 20:09 tehunter

Let me handle this.

WooilKim avatar Sep 20 '22 00:09 WooilKim

take

WooilKim avatar Sep 20 '22 00:09 WooilKim

I have a question. Where can I find the document file in the repository? I can not find it in docs directory. Thanks.

WooilKim avatar Sep 20 '22 02:09 WooilKim

pandas/docs/source/user_guide/style.ipynb

attack68 avatar Sep 20 '22 10:09 attack68

It seems like the whole notebook is mishandled, not just set_sticky.

attack68 avatar Sep 20 '22 10:09 attack68

@attack68 Thanks. I agree.

WooilKim avatar Sep 21 '22 08:09 WooilKim

@attack68 I'm in hard time finding the css "fit-content". I think it is not in the style.ipynb file. Can you give me an advice which file should I look into? Thanks.

WooilKim avatar Sep 22 '22 01:09 WooilKim

FWIW I have detected that if one removes the width: fit-content; CSS attribute value pair from the default pydata-sphinx-theme.css then this page all works as previously. The previous 1.4.x pydata-sphinx-theme.css did not seem to have this width value set.

Screenshot 2022-11-20 at 15 21 58

An alternative solution to avoid tampering with the global pydata-sphinx-theme might be to try to encode an overwrite specifically on the userguide ipynb page. But I don't know how to do either of these at present

attack68 avatar Nov 20 '22 14:11 attack68