/    Sign up×
Community /Pin to ProfileBookmark

A little question for all gus out there!

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 ? ?

[CODE]
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;
}

}

}
[/CODE]

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

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Feb 08.2003 — Your code seems to work in IE6,as far as I know runtimeStyle was IE proprietery property.

Khalid
Copy linkTweet thisAlerts:
@MithrandirauthorFeb 09.2003 — 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
Copy linkTweet thisAlerts:
@MithrandirauthorFeb 09.2003 — *push*

Can really nobody help me?

Greetings Mithrandir
×

Success!

Help @Mithrandir spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...