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 4 people (75%) answered Yes
Recently 3 of 4 people (75%) answered Yes

Entry

How to make a dynamically created cell an "editable" cell ?

Nov 3rd, 2003 07:31
Sudharsan Srini, Venkat Raman,


Hi 

   I was also trying to do the same thing when i found that a cell  
cannot be made editable. I found contradicting views in MSDN. 

If you try adding a DIV into the newly created cell with 
CONTENTEDITABLE=TRUE, then it may work. It actually does work for me. 

Find the sample code below.

function fninsertTableCell(tableID) {
		var tr = document.all[tableID].rows()
		var oCell 
		oCell=  tr.insertCell();
		oCell.innerHTML = '<DIV CONTENTEDITABLE=true 
STYLE="height: 100%; width: 100%;">This is the newly added cell </div>'
	}