Hi All,
I am pretty new to JS so forgive me if I am lame.
The issue:
I have a Javascript where I am storing all the data of a table in an array (say list_array)
eg.
for (i=1; i<row_count;i++) //Loop through the rows. Skipping header row and starting from 1
{
column = rows[i].getElementsByTagName(“td”);
var list_row_array = new Array(); // Create child array. Each element of this array represents a column on the row.
for(j=0;j<column_count;j++) // Loop through the columns for each row
{
// Read value from the cell and store it in array
list_row_array[column_names[j]] = column[j].getElementsByTagName(“span”)[0].innerHTML;
}
list_array[i-1] = list_row_array;
}
- I have 4 distinct values in column #4. say A, B, C &D
- I wish to color the rows in based on value in column #4. eg. if A then blue, B then red, C then black and D then white
- And I have to use the array in the JS only.
Please suggest any method.
Thanks and Regards,
AvantA