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

[Feature Request] I'd like to be able to highlight a different cell in each row #56

Open
walterdavis opened this issue Nov 30, 2022 · 3 comments

Comments

@walterdavis
Copy link

Imagine a table like this:

foo | bar | baz
---------------
red | clear | clear
clear | red | clear
red | clear | clear

Where those are the assigned background colors for the individual cells within each row. The idea is to be able to call out a cell where data needs to be adjusted, but which cell is dependent on the data making up that row. Is there some way (passing a block, perhaps) that this could be made to happen? All the documentation about the various background color styling options seem to apply only to individual rows or all rows.

@westonganger
Copy link
Owner

This can already be done. If you are not already doing so then you would start using the :data option. When generating the :data array you can can also generate your :range_styles array according to your data (ideally within the same loop for performance optimization)

@westonganger
Copy link
Owner

westonganger commented Dec 2, 2022

We do have :conditional_row_styles but that wont work for this scenario. Maybe :conditional_cell_styles could be added to help here. Even though :range_styles already is capable of this functionality, it more or less requires switching to the :data option, so there is benefit for :instances users. If added :conditional_cell_styles would be one lower applied 2nd to last, then :range_styles last (highest precedence).

@westonganger
Copy link
Owner

I started dabbling at this implementing something like this in #58 not sure the approach is great yet

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

No branches or pull requests

2 participants