SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 innerHTML for tables

Why doesn't something this simple work in IE 6?

<script>
  var tbl=document.getElementById("menuTable");
  tbl.innerHTML = "<tbody><tr><td>hello</td></tr></tbody>";
</script>

...

<table id="menuTable"></table>

Started By ctcrmcou on Feb 20, 2004 at 7:43:10 AM

29 Response(s) | Reply

Earlier Replies | Replies 9 to 15 of 29 | Later Replies
Goto Page: 5 4 3 2 1
ctcrmcou on Feb 21, 2004 at 8:33:57 AM (# 9)

I couldn't agree more - but a minor tweak, in this case can make a difference, at least for now (by innerHTML-ing the outer div).  So as I understand it Netscape 7 has migrated into Mozilla to produce the Firebird, Firefox browsers?  I do see that Firebird works better, although I do notice those typical "netscape" characteristics from time to time during rendering.


frumbert on Feb 22, 2004 at 4:45:20 PM (# 10)

Holo: If only it were always that simple. I have clients with thousands of corporate desktops who still insist on prominently placing Netscape 4.7 and netscape 6 on their desktops and then expecting support for them in the pages.


MHenke on Feb 23, 2004 at 1:34:34 AM (# 11)
This message has been edited.

> [...] with thousands of corporate desktops who still insist on prominently placing Netscape 4.7 and netscape 6 [...]
PITA. You have my honest pity.
Do you at least get danger pay? =]


jreeder on Feb 23, 2004 at 11:26:58 AM (# 12)

Netscape I think donated their code several years ago to the open source Mozilla project, thus the similarities. Mozilla is a quantum leap ahead of where the Netscape browser was when Netscape quit, far more DOM compliant unless you force IE into compliance mode with a DOCTYPE declaration and I feel nicer overall, but that is just my opinion. Ironically, I develop on an intranet site with a user base 100% IE.

As far as your question,I don't know whether you are looking for a philosophical answer or a practical one. The following will insert a row and cell into your table under IE (which sucks but I can deal with it):

row=tbl.insertRow();
cell=row.insertCell();
cell.innerText="hello";

You can set all the other properties of the cell and create custom attributes also with the syntax cell.[property]="whatever", you can also use innerHTML instead of innerText. Incidentally, this is DOM level 1 standard.

For the philosophical answer you have to call M$ and ask their developers.


MHenke on Feb 24, 2004 at 1:10:14 AM (# 13)

> Incidentally, this is DOM level 1 standard.
You don't mean innerHTML, do you? It's definitely not DOM standard.


jreeder on Feb 24, 2004 at 7:32:05 AM (# 14)
This message has been edited.

My bad...I misspoke. innerHTML and innerText are not DOM standard but supported by IE and NS6+ and Mozilla, thanks for the correction.


jreeder on Feb 24, 2004 at 7:59:24 AM (# 15)

Well, maybe Mozilla and NS. I can't seem to get it to work in Mozilla but I am not very familiar with it anyway. Works fine under IE though...
I'll just shut up now...the hole is getting rather deep. :-)


Earlier Replies | Replies 9 to 15 of 29 | Later Replies
Goto Page: 5 4 3 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.