Aaron Fude wrote:
I will then use COOLjsTree (http://javascript.cooldev.com) to hide all
but one table. The darn thing is, COOLjsTree requires its HTML content
to be a valid javascript string which is cubersome for a table with 50
lines. So I thought I would put that table in a div and just mention the
dive in the javascript string.
Hmm, that's a damned ugly way of doing it. A better idea, that will still
work when JavaScript is disabled, would be to give each table an id (eg.
table1, table2, table3 etc) and then have a script that is called through
the onload() event in the body element.
The script would then loop through each of the table ids and set the
display property for that element to "none", obviously leaving one of the
tables displayed.
Then it's just a matter of creating a link for each table that when
clicked does the opposite of the onload() script. These links can also be
written out with JavaScript so that script-disabled browsers don't see
them.
See
http://www.webpageworkshop.co.uk/main/article11 for an example of how
this can be done with lists. Adapting it to table shouldn't be too hard a
task.
--
Dylan Parry
http://www.webpageworkshop.co.uk - FREE Web tutorials and references