Hi,

I have to deal with a somehow complicated issue.

I have a html table with this layout:

row1 category 1 light
row2 category 1.1 dark
row3 data light
row4 data dark
row5 category 1.2 dark
row6 data light
row7 data dark
row8 category 2 light
row9 headline 2.1 dark
.
.
.

I generate alternating row colors with VBscript. But now I have to use a
clientside javascript to display and hide the subordinate hierarchy elements
when the user clicks on the category headlines.

The page loads like this:

row1 category 1 light
row7 category 2 light

row2 will be displayed, when the user clicks on row 1, row3-4 will be
displayed, when the user clicks on row 2 ... How do I create a table with
alternating row colors, regardless if the subordinate hierarchy elements are
diplayed or not?

kind regards, Tilo Kley

Re: alternating colors in hierarchic lists? by Tilo

Tilo
Sun Aug 03 07:49:40 CDT 2003

Sorry, the table has the following layout - the colors are correctly
alternating, when all rows are displayed (the number of rows, categries and
subcategories may change):

row1 category 1 light
row2 category 1.1 dark
row3 data light
row4 data dark
row5 category 1.2 light
row6 data dark
row7 category 2 light
row8 headline 2.1 dark



Re: alternating colors in hierarchic lists? by Evertjan

Evertjan
Sun Aug 03 08:21:57 CDT 2003

Tilo Kley wrote on 03 aug 2003 in microsoft.public.scripting.vbscript:
> I generate alternating row colors with VBscript. But now I have to use
> a clientside javascript to display and hide the subordinate hierarchy
> elements when the user clicks on the category headlines.

Is this a vbs or a javascript question? Most of it is DOM:

for i= 0 to mytable.childNodes(0).childNodes.length
if i mod 2 = 0 then
mytable.childNodes(0).childNodes(i).style.BackgroundColor="#ccc"
else
mytable.childNodes(0).childNodes(i).style.BackgroundColor="#aaa"
end if
next

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)