A little question for all gus out there!

wxdqz

New Member
I'm modifying a online html editor and a part of the code doesn't work. Can you check it and say me what's wrong with it, PLEASE :) ?


function showTable() {
var Tables = doc.getElementsByTagName("TABLE");
for (j=0;j<Tables.length;j++){
if(Tables[j].border == 0){
Tables[j].runtimeStyle.borderWidth = 1;
Tables[j].runtimeStyle.borderColor = "#BCBCBC";
Tables[j].runtimeStyle.borderStyle = "dotted";
Tables[j].runtimeStyle.borderCollapse = "separate";
}
}
var Cells = doc.getElementsByTagName("TD");
for (j=0;j<Cells.length;j++){
var tbl = Cells[j].parentElement
while (tbl) {
if (tbl.tagName == "TABLE") {
if (tbl.border == 0) {
Cells[j].runtimeStyle.borderWidth = 1;
Cells[j].runtimeStyle.borderColor = "#BCBCBC";
Cells[j].runtimeStyle.borderStyle = "dotted";
Cells[j].runtimeStyle.borderCollapse = "separate";
}
}
tbl = tbl.parentElement;
}

}

}


The function is supposed to display tables with no border. The first part was easy. But then I had a problem displaying the cells of these tables with a border. Can you correct this script please???

THX & Greetings Mithrandir
 
Back
Top