S
Stefan Mueller
I'm using the following code to sort a html table:
...
var_table = this.sorttable_tbody;
for (rowcounter = 0; rowcounter < row_array.length; rowcounter++)
{
var_table.appendChild(row_array[rowcounter][1]);
}
The 'appendChild' method moves each row of my existing html table in a
sorted manner to the end of the html table. That really works great an
very fast. However, the rows in my html table look like
<tr class = "tableentry_odd">...
<tr class = "tableentry_even">...
I use this so that each second row has a different background color.
But after I've sorted the html table the background colors get mixed
up.
My intention is now to read the content of 'row_array[rowcounter][1]'
and to adjust '<tr class = "tableentry_...">...' so that each second
row has a different background color again. However, I've no idea how
to read and modify the content of 'row_array[rowcounter][1]'.
If I do 'alert(row_array[rowcounter][1]);' the output always shows
'[object]'.
Does someone know how to read the content of 'row_array[rowcounter]
[1]' and if my intention to modify the content of 'row_array
[rowcounter][1]' makes sense so that each second row has a different
background color even after the html table got sorted?
...
var_table = this.sorttable_tbody;
for (rowcounter = 0; rowcounter < row_array.length; rowcounter++)
{
var_table.appendChild(row_array[rowcounter][1]);
}
The 'appendChild' method moves each row of my existing html table in a
sorted manner to the end of the html table. That really works great an
very fast. However, the rows in my html table look like
<tr class = "tableentry_odd">...
<tr class = "tableentry_even">...
I use this so that each second row has a different background color.
But after I've sorted the html table the background colors get mixed
up.
My intention is now to read the content of 'row_array[rowcounter][1]'
and to adjust '<tr class = "tableentry_...">...' so that each second
row has a different background color again. However, I've no idea how
to read and modify the content of 'row_array[rowcounter][1]'.
If I do 'alert(row_array[rowcounter][1]);' the output always shows
'[object]'.
Does someone know how to read the content of 'row_array[rowcounter]
[1]' and if my intention to modify the content of 'row_array
[rowcounter][1]' makes sense so that each second row has a different
background color even after the html table got sorted?