Click to See Complete Forum and Search --> : A little question for all gus out there!


Mithrandir
02-08-2003, 08:55 AM
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

khalidali63
02-08-2003, 09:07 AM
Your code seems to work in IE6,as far as I know runtimeStyle was IE proprietery property.

Khalid

Mithrandir
02-08-2003, 07:04 PM
The point is, that the code doesn't work with any browser. And my answer is why!

Can anyone tell me what's wrong? It's also OK to write a completely different script with the same functions!

Greetings Mithrandir

Mithrandir
02-09-2003, 03:08 AM
*push*

Can really nobody help me?

Greetings Mithrandir