Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window width in IE, I want a horizontal scroller

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
Hey everyone,

I have a div tag that is holding a table. The table consists of 2 rows. Each row has 10 charts in it. I have set the div tag to be overflow:auto so if the browser window is not wide enough then it will create a horizontal scroll bar on the div but the whole web page will not have a horizontal scroll. Does that make sense?

It makes sense to Firefox, but not to IE. In IE it just displays all the charts all the way out, filling up the div and forcing the whole web page to scroll. Here is the div code I am using:

Code:
<div id="chartScroller" style="height:368px; overflow:auto; border: 3px solid blue;">

Any ideas?

-Greg
 
You need to give your div a width, else browsers will assume 100% and IE has certain problems with understanding just how much 100% really is. If you give it a definite width, both browsers will honour it.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Yeah I considered that, but I was hoping to be able to compensate for the variety of monitor resolutions out there. If i give it a fixed width, say 750, then it will look great for people with 800x600 resolution but any larger will leave a lot of blank space to the right for no apparent good reason. And of course if I make the width any larger then people still running 800x600 will get a horizontal scroll bar for the web page.

I just figured since Firefox handles it perfectly that maybe there was a work around for IE to make it behave the same.

-Greg
 
I never said you need to give it 750px width. You could opt for 80% or something. :)

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Ok I think I finally figured it out. Basically when I took that one div and put it on a page by itself it worked perfect in both browsers. That div was originally nested within a table and that was causing IE to make it fubar.

I was able to implement a new solution using divs as the container instead of using a table and I got it working now. Thanks for your input!

-Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top