Click to See Complete Forum and Search --> : Please help with a dynamic table.


minh
03-03-2003, 02:09 PM
I am looking for a way to display table column dynamically.

This is what I want.

I have an <OPTION> list of things I want do display in a table.

<OPTION>
Item 1
Item 2
Item 3
...so on
</OPTION>


If I slect on Item1, the table will add a COLUMN show the value of Item1,

Select Item2, the table will add Item2 Column in front of Item1 Column....so on.

If I deselect Item1, the table will take off the COLUMN for Item1.

Basically, the table will grow dynamically.

If you have any souce codes, I would appreciate.

thank you.

khalidali63
03-03-2003, 02:35 PM
The link below should help you write a program like what you want.

http://www.mozilla.org/docs/dom/samples/dynatable-light/index.html

Cheers

Khalid

Phil Karras
03-03-2003, 02:58 PM
You can go to my web site listed below and look up example: help196.htm.

It's crude but shows one way to add a table row using innerHTML.

from the home page to run the example type in: [help/help196] and click on [GoTo] or [Open]

minh
03-03-2003, 08:59 PM
Hello Khalid:

Thanks for your reply. I clicked the link but it did not work.

It complained about the Javascript error. Please correct it.

http://www.mozilla.org/docs/dom/samples/dynatable-light/index.html

khalidali63
03-03-2003, 10:04 PM
which browser did u use...its NS website
NS6+ would work

Khalid

Phil Karras
03-04-2003, 12:53 PM
Yes, sorry I forgot to mention it but it does have code in it (commented out) for it to work in IE as well. It's up to you to download it and test it for both browsers and then do as you will to it.

I only made it work to remove for NS. You'll need to add code to determine which browser your client is using so it uses the correct code for that browser.

Then you'll need to add the code back for adding lines for IE and then create the ones for removing a line for IE.

Hey, it's free if you want to pay I'm willing to do all the work for you. ;)