Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Setting div's innerhtml behaves differently in IE and Mozilla

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a table and have some rows in it.In one of the td(cell) i have some text + a empty DIV tag inside it as shown in below code:



Using javascript when i am inserting some html into the div having id "div1" that is

div1.innerHTML = "my html code here"

the gap increases between ROW 2 and ROW 3 in Internet Explorer version 6.0 while the same is working fine in Mozilla version 5.0

So can anybody please let me know the reason behind this behavior and how can i make this work correctly ??

Thanks
[ August 04, 2007: Message edited by: Jignesh Gohel ]
 
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if I understand exactly what you mean, but I think I may know what you are talking about.

IE is pretty stupid about empty cells, and it's probably changing the height of the cell once you add something to it.

The first thing I'd try is to not leave the cell empty, but put a non-breaking space in it so that IE doesn't think it's empty:

<div id="div1">&nbsp;</div>
[ August 04, 2007: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jignesh,

What do you mean by saying? �


the gap increases between ROW 2 and ROW 3 in Internet Explorer version 6.0 while the same is working fine in Mozilla version 5.0



BTW, div1 is actually in ROW2, right?

Maybe you want to take HEIGHT: 587px and spread it evenly across the three rows by using a div of 587px/3 for each one of them....

Regards,
Dan
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic