Skip to content

QST: Styler puts all CSS ids on a single attribute which is not rendered #39400

Closed
@NewtonXu

Description

@NewtonXu
  • [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:

#T_394319f6_5c20_11eb_832b_04ed338ce712row0_col6,#T_394319f6_5c20_11eb_832b_04ed338ce712row0_col7, 
...
#T_394319f6_5c20_11eb_832b_04ed338ce712row1_col6 { background-colour: red }

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stylerconditional formatting using DataFrame.styleUsage Question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions