Skip to content

ENH: Styler accepts css-strings input args as well as list of (attr,value) pairs #39563

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

Closed
attack68 opened this issue Feb 2, 2021 · 0 comments · Fixed by #39564
Closed

ENH: Styler accepts css-strings input args as well as list of (attr,value) pairs #39563

attack68 opened this issue Feb 2, 2021 · 0 comments · Fixed by #39564
Labels
Enhancement Styler conditional formatting using DataFrame.style
Milestone

Comments

@attack68
Copy link
Contributor

attack68 commented Feb 2, 2021

Is your feature request related to a problem?

Currently the styler has the ability to set_table_styles provided they are characterised with a css-selector and list of attribute value pairs, e.g.

styler.set_table_styles([{'selector': 'th', 'props': [('color', 'red'), ('font-size', '1em'), ('font-weight',  'bold')]}])

Even the legacy docs describe this as a bit of a pain, and for someone used to css, they will be typically looking for a css-style solution:

styler.set_table_styles([{'selector': 'th', 'props': 'color:red;font-size:1em;font-weight:bold;'}])

Describe the solution you'd like

optionally use the input argument valid CSS format above.

API breaking implications

none if backwards compatible.

@attack68 attack68 added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 2, 2021
@jreback jreback added this to the 1.3 milestone Feb 4, 2021
@lithomas1 lithomas1 added Styler conditional formatting using DataFrame.style and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants