faqts : Computers : Programming : Languages : JavaScript : Tables

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 9 people (33%) answered Yes
Recently 3 of 9 people (33%) answered Yes

Entry

How can I output the contents of the cells in my dynamicly generated table(using loop)?

Nov 4th, 2003 07:50
Sudharsan Srini, Thomas A,


Hi Thomas,

I tried something similar and it works for me. I suggest you try 
adding <FIELDSET> and get the innerHTML for the FIELDSET.

Imagine you have some static content already in a table.. I suggest 
you use the <FIELDSET> as a wrapper for the table. After this you may 
add rows/cells dynamically through your functions. 

You can get the content of the entire fieldset  thro

document.all['fs2'].innerHTML

--------------------------------------------------
A sample table with a <FIELDSET> wrapper 
--------------------------------------------------

<fieldset CONTENTEDITABLE="true"   id="fs2">
<table cols=2 width="50%" border=1 id="tab1">
	<tr CONTENTEDITABLE="true" ONclick="fnTRClicked
(this.rowIndex)">
		<Td ONclick="fnTRClicked()"> This is a sample content 
			&nbsp;
			<input  type=textbox  value=324  id=textbox1 
name=textbox1 selectable=true>&nbsp;
		</td>
		<Td align=center > 
		<DIV CONTENTEDITABLE=true STYLE="height: 100%; width: 
100%;"><input  type=textbox CONTENTEDITABLE=true value=324  
id=textbox1 name=textbox1><DIV>
			
		</td>
	</tr>
</TABLE>
</FIELDSET>


You should a got a clue of how this be worked around to address your 
needs.