spreadsheet_architect icon indicating copy to clipboard operation
spreadsheet_architect copied to clipboard

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

Open walterdavis opened this issue 3 years ago • 3 comments

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.

walterdavis avatar Nov 30 '22 17:11 walterdavis

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 avatar Dec 02 '22 01:12 westonganger

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 avatar Dec 02 '22 02:12 westonganger

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

westonganger avatar Dec 02 '22 05:12 westonganger