[Javascript] Not being displayed in IE

M lists at gazelasport.sk
Fri Dec 15 02:03:17 CST 2006


IE requires <tbody> element. Create it inside the table, give id
"summary_table" instead of the table:

<table>
 <tbody id="summary_table">
 </tbody>
</table>

This will work in all

Peter Lauri  wrote / napísal(a):
> Hi group,
> 
> I have gotten a weird thing going on. I have confirmed that the below code
> works well in Firefox and Opera. However, in IE there is something strange
> going on.
> 
> As you see in the code there are <tr> being created and put into a table. I
> have confirmed that all the <tr> are being inserted into the table in IE by
> counting and traversing the DOM for the table. However, the table does not
> change as it should :(
> 
> Is there something special that needs to be done when doing this kind of
> thing in IE? Note that sc is a multidimensional array.
> 
> Best regards,
> Peter Lauri
> 
> function populateCartGraphic(sc) {
> 	summarytable = document.getElementById("summary_table");
> 	
> 	while(summarytable.childNodes.length >= 1) {
> 		summarytable.removeChild(summarytable.firstChild);
> 	}
> 	
> 	total = 0;
> 	
> 	for(i=0; i<sc.length; i++) {
> 		newrow = document.createElement('tr');
> 		temp1 = document.createElement('td');
> 		temp1.innerHTML = sc[i][1] + ", " + sc[i][2];
> 		newrow.appendChild(temp1);
> 
> 
> 		temp1 = document.createElement('td');
> 		temp1.innerHTML = "&pound;" + sc[i][3];
> 		newrow.appendChild(temp1);
> 		
> 		temp1 = document.createElement('td');
> 		temp1.innerHTML = sc[i][4];
> 		newrow.appendChild(temp1);
> 
> 		linetotal = sc[i][3]*sc[i][4];
> 		
> 		temp1 = document.createElement('td');
> 		temp1.innerHTML = "&pound;" + linetotal;
> 		newrow.appendChild(temp1);
> 		
> 		summarytable.appendChild(newrow);
> 
> 		total += linetotal;
> 
> 	}
> 	
> 	
> 	newrow = document.createElement('tr');
> 	temp1 = document.createElement('td');
> 	temp1.innerHTML = " ";
> 	newrow.appendChild(temp1);
> 
> 
> 	temp1 = document.createElement('td');
> 	temp1.innerHTML = " ";
> 	newrow.appendChild(temp1);
> 	
> 	temp1 = document.createElement('td');
> 	temp1.innerHTML = " ";
> 	newrow.appendChild(temp1);
> 	
> 	temp1 = document.createElement('td');
> 	temp1.innerHTML = "&pound;" + total;
> 	newrow.appendChild(temp1);
> 	
> 	summarytable.appendChild(newrow);
> 	
> }
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list