Skip to content

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

Closed
@attack68

Description

@attack68

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementStylerconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions