0

I'm attempting to change the colors of individual cells in an HTML table populated by a 2d array in Javascript and I have been searching stackoverflow for a while now and every answer seems to involve Jquery. I was wondering if anyone knows a way to do this without using Jquery.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • 2
    Please show us, what did you try, and what's your HTML. – FZs Jul 11 '19 at 15:31
  • 2
    I prefer adding such things to the logic that creates the table from the array. The alternative is to select the cells from the DOM again, according to the equation, after rendering the table. – Shilly Jul 11 '19 at 15:33
  • 1
    I'm not entirely certain how much I'm legally allowed to show based on an NDA, this is something I'm attempting to solve for an internship. No one here seems to know how to do this either. –  Jul 11 '19 at 15:36
  • I'm pretty sure an unbelievable amount of us finds this easy to do either with jQuery or without. If you show us code, maaaayybe we can help. – Jabberwocky Jul 11 '19 at 15:47

1 Answers1

1

The closest things you could get without heavily programming in JavaScript by pure CSS/HTML.

https://stackoverflow.com/a/1520501/40214

However, in your case that the data source is actually coming from JavaScript and generate table from a 2d array. It make it more sense to evaluate your formula while generating the HTML structure and update class or style or --var accordingly.

Dennis C
  • 24,511
  • 12
  • 71
  • 99