-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
QST: Styler puts all CSS ids on a single attribute which is not rendered #39400
Comments
I can see from your I would highlight a few things to you:
And then make sure you prepended the manual external css classes so:
Let us know how you get on - its useful for development.. |
Here is an example of what I am trying to do. In my highlight_min_max, the colour I highlight cells with are determined by other cells, hence why I use the apply function. So I unfortunately cannot take advantage of applying colouring to entire rows or columns. I have updated my pandas to 1.2.1 and I still see the same problem with the above code. |
My example previously didn't have enough elements apparently.
generates an HTML file where there are only 8192 (13 bits) styled cells of 20000 that should be styled. There is nothing wrong with the HTML. Therefore I suggest this is a browser limitation issue, not pandas. Update: In Opera and Chrome this fails after row 8192, but Safari and Firefox actually render the full 20000 rows. The below code uses css classes to achieve the result (you might need to wait for pandas 1.3.0 for a bugfix to
This HTML renders correctly since there is only a small style element: It is also optimised from an HTML transfer perspective. |
Yes, it is a limitation with the browsers, but in the sense that pandas should not be putting that many id's on a single attribute. |
[X ] I have searched the [pandas] tag on StackOverflow for similar questions.
[X ] I have asked my usage related question on StackOverflow.
Question about pandas
I am trying to use the pandas dataframe styler to colour cells of the dataframe and present the result on a webpage.
The rendered CSS shows up as follows:
For large tables, the number of ids can exceed 4096. When processed on the web-browser, the id's after 4096 are ignored and the cells are not coloured. Resulting in partially coloured HTML tables.
I have verified my style function works by downloading the Excel file of the styled object, which is coloured correctly. It seems to be a limitation on various web-browsers (Chrome, Firefox, Edge).
I have also tried randomizing the exact hexcode used to colour the cells, which fixes the problem.
What can I do?
The text was updated successfully, but these errors were encountered: