Skip to content
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

Add value attribute to <td> elements for CSS conditional formatting #458

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fgiuba
Copy link

@fgiuba fgiuba commented Mar 11, 2019

Hi everyone,

I need to apply pure CSS conditional formatting to rendered tables, something like you can see here.

The result must look like the following table:
css-conditional-formatting

To get this working we need an attribute on the <td> elements on which apply the CSS attribute selector rules.

This PR add to Table.render() the value_attribute option. If set to True, each <td> element value will be replicated into a new value attribute added to the <td> element itself. If set to False, the table will be rendered as usual.

fgiuba added 3 commits March 11, 2019 14:13
Table.render() now accepts the `value_attribute` parameter.

If set to True, each <td> element will be created with the `value`
attribute that mirror the content of the element itself. This can be
used to apply CSS conditional formatting rules with the CSS selector
functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant