Click to See Complete Forum and Search --> : [RESOLVED] DOM Table Caption in IE 6


Donotalo
April 17th, 2008, 12:41 AM
function createTitleUrlTable() {
var newtable = document.createElement("table");
newtable.border = "0";

for (var i = 0; i < 4; i++) {
newtable.insertRow(i);
newtable.rows[i].insertCell(0);
newtable.rows[i].insertCell(1);
newtable.rows[i].cells[0].width = "20%";
}

newtable.rows[0].cells[0].innerHTML = title_HTML;
newtable.rows[0].cells[1].innerHTML = title_input;
newtable.rows[1].cells[0].innerHTML = url_HTML;
newtable.rows[1].cells[1].innerHTML = url_input;
newtable.rows[2].cells[0].innerHTML = category_HTML;
newtable.rows[2].cells[1].innerHTML = category_select;
newtable.rows[3].cells[0].colSpan = 2;

return newtable;
}

var newtable = createTitleUrlTable();
newtable.caption = document.createElement("caption");
In IE 6, the script execution stops at the last line. It is ok in firefox. How to fix it?

Donotalo
April 17th, 2008, 12:47 AM
Solved by using createCaption() function. :)