If you made a template for printing or HTML export, you can offer it to the others here. You can also ask here for help about these templates
RRUU
Posts: 13 Joined: 2006-02-21 11:22:33
Location: NZ
Post
by RRUU » 2006-10-16 03:14:48
Is there anyway to have every 2nd row in a table a differnt color to make it more easier to read?
Something like this...
antp
Site Admin
Posts: 9651 Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:
Post
by antp » 2006-10-16 08:02:23
You mean in HTML export? It is probably possible using Javascript to change the layout dynamically.
kazgor
Posts: 175 Joined: 2006-05-08 13:13:52
Contact:
Post
by kazgor » 2006-10-16 21:21:12
ok first you need to create a stylesheet for the alternate colours, eg OddRow & EvenRow
then when you're drawing the table in each TD add a class but instead of using the CSS (eg odd or even row) use a variable instead.
Now there will be some kind of FOR loop to draw the table you show, so you would have a line like
if (d % 2 == 0) {cellcolour=EvenRow'} else {cellcolour='OddRow'}
D being your loop variable.
heres an example line i used to build up an HTML tag
hotnews=hotnews+"<td width='20%' valign='top' class=" + cellcolour + ">"+ bold + v_date[d] + "</td>"
later i do a document.write(hotnews) do display the HTML i've buildup.
but really depends on the script you're using and how you can integrate the above into it.
antp
Site Admin
Posts: 9651 Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:
Post
by antp » 2006-10-17 14:56:02
Another solution is to browse the HTML "tree" in Javascript and add a class to the table elements, so the table is built in HTML and only colors are added to Javascript.