I created a table with bootstrap execution styles, in which I have a dynamic table that has a Rank column that contains several values, starts from 1 to 100, and using jquery and bootstrap I convert the values to a progress bar, as shown in the violin. The Th code is working fine, but the problem is with the color, it will now display everything in blue, in fact I want different colors based on the values of the progress count, say 10 is yellow, 20 is blue, 35 - red, etc., Only the color of the duplicates should be repeated for the same value, otherwise a different color. color can be dynamic.
My code is below
Jsfiddle
$("#table").children("tbody").children("tr").each(function (i) {
var col = $(this).children("td.value");
console.log(col.html());
var pro = '<div id="left"><div class="progress" id="percentage"><div class="progress-bar" style="display: block; float: right;width: ' + col.html() + '%;"></div></div></div><div id="right"> ' + col.html() + '</div>';
col.html(pro);
});
Can someone tell me some solutions for this