ei watsup ppl, its me again

im having trouble using this function cause i don't really know yet how the document function really works... but i hope you guys can help me again in this another great adventure of mine...

well this is what i wanted to do...

i wanted to make a dynamic table... how can i explain this... umm, u see i have a "create new table" button in my html that evertime i clicked it, it should dynamically make a new table inside the same page using document.writeln("<table>....</table>"); on a javascript funtion...
the point is that it should be an endless table as long as i keep pushing the "create new table" button...

but... here is the most challenging part here... hope u understand what im saying...

everytime i make a table it should be nested inside the table i made earlier... so the many times you clicked the "create new table" button is the times of how many nested tables should be made in the html...

i hope you got what my prob is... and i am open to any idea on how to make a dynamic nested table even if you cant choose the document.writeln function... hope you guys can help me... tnx in advance...