Dynamically change column color

Dynamically change column color

KeiSenpaiKeiSenpai Posts: 21Questions: 8Answers: 0

Hello!
I have seen various methods of changing the row color based on a cells value. My question is, would it be possible to highligh/change the color of a column based on the header? I have the dates being shown in the header and would like to highlight/change the color of current day if that is possible.

My header's look something like this:

SUN
DAY 1
04/25/2021

I appreciate any guidance and help!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • KeiSenpaiKeiSenpai Posts: 21Questions: 8Answers: 0

    Hello colin!

    Thank you for the reply. Here is a recent sample of what I am working. However, I have not started anything for the highlighting/coloring of the column because I was not sure where to start.

    https://jsfiddle.net/t7nges4h/
    

    Thank you!

  • KeiSenpaiKeiSenpai Posts: 21Questions: 8Answers: 0

    I ended up solving it with this:

              "targets": [currentDay], "sClass": "highlightToday"
            }
    

    My columns are 0-14 (1-14 being days and calculate the number to highlight. :smile:

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    Nice, thanks for posting the fix.

    Colin

This discussion has been closed.