Connecting Tech Pros Worldwide Help | Site Map

Table DOM in Mozilla Vs. IE.

  #1  
Old August 27th, 2008, 01:38 PM
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Posts: 2,452
Have a look at my code snippet ...
Expand|Select|Wrap|Line Numbers
  1. function add_row(){
  2.  var tr = some_reference;
  3.  document.getElementById('tab_id').appendChild(tr);
  4. }
  5.  
Expand|Select|Wrap|Line Numbers
  1. <table id=tab_id>
  2. <tr id=tr_id>....</tr>
  3. .....
  4. </table>
  5.  
It works in Mozilla but not in IE.
If i do
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('tr_id').parentNode.appendChild(tr);
,
now it works in both :-)
Could you explain why this happens ..experts ?
  #2  
Old August 27th, 2008, 01:57 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,528
Provided Answers: 12

re: Table DOM in Mozilla Vs. IE.


In IE, you need to append to the tbody rather than the table. See this part-article.
  #3  
Old August 27th, 2008, 01:59 PM
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Posts: 2,452

re: Table DOM in Mozilla Vs. IE.


Quote:
Originally Posted by acoder
In IE, you need to append to the tbody rather than the table. See this part-article.
Yeah i know that's why i knocked the experts ;)
One more thing now a days are you busy ? I thrown a discussion over the core topics ..functions and objects, you didn't take part in that
i expected you to throw something ...... ;)
  #4  
Old August 28th, 2008, 10:51 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,528
Provided Answers: 12

re: Table DOM in Mozilla Vs. IE.


I did see that thread, but didn't participate in it. Some of the concepts I needed to figure out for myself before I could contribute, but I think it's resolved now.
  #5  
Old August 28th, 2008, 01:00 PM
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Posts: 2,452

re: Table DOM in Mozilla Vs. IE.


Quote:
Originally Posted by acoder
I did see that thread, but didn't participate in it. Some of the concepts I needed to figure out for myself before I could contribute, but I think it's resolved now.
Oh ...Sure man.
yeah it's now got figured out .....for myself ...
really thanks to Bytes.com experts team from here i came 2 know lot of details ..Java as well as JavaScript ;)

Basically i am also interested in C and C++ which are my heart ;) ...but i could not find out time to take part in those discussions ....
A lot of pressure in my work ...;(
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
table added to div doesn't appear when using IE James Black answers 1 April 28th, 2006 12:55 AM
DOM table manipulation not consistent in IE vs Mozilla J. Baute answers 3 July 23rd, 2005 08:16 PM
NN vs. IE - time to render page Paul Thompson answers 6 July 23rd, 2005 01:19 PM
'div id' vs 'div class' dr. zoidberg answers 48 July 20th, 2005 11:19 PM