M
Melissa Mussitsch
I've done this before while creating a brand new table.
But the code below is not working and I keep getting the error:
"Internet Explorer cannot open the Internet site .....
Operation aborted"
Here is the code:
myBody=document.getElementsByTagName("body").item(0);
mytablebody = document.getElementById('product').getElementsByTagName("TBODY" )[0];
newrow=document.createElement("TR");
newrow.setAttribute("bgColor", "#EFECCB");
//Family
newcell=document.createElement("TD");
currenttext=document.createTextNode("Family");
newcell.appendChild(currenttext);
newcell.setAttribute("width","10");
newcell.setAttribute("align", "center");
newrow.appendChild(newcell);
//Product Description
newcell=document.createElement("TD");
currenttext=document.createTextNode("Product Description");
newcell.appendChild(currenttext);
newcell.setAttribute("align", "center");
newrow.appendChild(newcell);
mytablebody.appendChild(newrow);
It's pretty basic code. I put the TR, TD, TD in by hand and it worked fine.
I wanted to make sure it wasn't because I had some mismatching <TABLE> tags.
Any ideas?
Melissa Mussitsch
But the code below is not working and I keep getting the error:
"Internet Explorer cannot open the Internet site .....
Operation aborted"
Here is the code:
myBody=document.getElementsByTagName("body").item(0);
mytablebody = document.getElementById('product').getElementsByTagName("TBODY" )[0];
newrow=document.createElement("TR");
newrow.setAttribute("bgColor", "#EFECCB");
//Family
newcell=document.createElement("TD");
currenttext=document.createTextNode("Family");
newcell.appendChild(currenttext);
newcell.setAttribute("width","10");
newcell.setAttribute("align", "center");
newrow.appendChild(newcell);
//Product Description
newcell=document.createElement("TD");
currenttext=document.createTextNode("Product Description");
newcell.appendChild(currenttext);
newcell.setAttribute("align", "center");
newrow.appendChild(newcell);
mytablebody.appendChild(newrow);
It's pretty basic code. I put the TR, TD, TD in by hand and it worked fine.
I wanted to make sure it wasn't because I had some mismatching <TABLE> tags.
Any ideas?
Melissa Mussitsch