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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make web content fit in a window w/out scroll bars

Status
Not open for further replies.

bnymk

Programmer
Feb 7, 2003
296
US
Hi All;

I have a web site that has three frames. The first frame has multiple drop down menus and text fields where an end user can make his/her selection to display a restultset in a table format. The resultset is displayed in the second and third frames. The second (middle) frame displays the table headers and the last frame displays the resultset. Depending on the query/selection that users make, some of the resultsets can have several columns and when it gets displayed windows automatically inserts a horizontal scroll bars. What I want is to find a way to get rid of the scroll bars that gets inserted when the column is more than eg. 14 and be able to display all of it in a normal window size. As is now, I can only get rid of displaying the scroll bars if I force users to modify their screen resolution to be 1024 by 768 pixels. How can I be able to display the resultset without the scroll bars and without forcing the user to modify their screen resolution settings.

Thanks in advance.
 
Yeah, I have tried that before posting my question but that one still displays the scroll bars.
 
hire a programming guru and pay them!

You are asking for a Golden Egg -- Listen you need to take a look at what you are asking

I can only get rid of displaying the scroll bars if I force users to modify their screen resolution to be 1024 by 768 pixels

what if their resolution is larger -- then they have lots of empty space! Why is vertical scrolling so bad -- 98% of websites use them -- The average User expects them -- Why rack your brain over such a problem?

your only solution would be to plan your site at the lowest resoltuions 800x640 and go from there -- but that would probably only show like 2-4 results.

I hate to be so blunt here but it just seems like you are on a hunt for the fountain of youth.

If someone does prove me wrong well then i owe you and that person a round of your favorite soda-pop [cry]

Sometimes the Answer You Are LOOKING for can be FOUND BY SEARCHING THE FAQ'S @&%$*#!!!
 
well if you have read my question thoroughly, you will notice that my question is on how to get rid of the the vertical scroll bar but the horizontal. And I know this can be done (I think using CSS) and all I need is someone to point me to the right direction.
 
overflow-x: hidden;

in your body should do that. Note that this is not a proper CSS property, but a MS thing. IE5+ support it, other browsers don't. others can use overflow: hidden; which hides both scrollbars. Though I am wondering, if your output is table (with presumably text) setting a 100% width to that table should ensure that it does not fall off the screen:

<table style=&quot;width: 100%;&quot;>
 
sorry i didnt see any mention of what scrollbars you wanted hidden -- but i shouldve guessed from you mentioning comlumns -- the same goes for that as well.

you could design using %'s -- also overflow-x:hidden will just hide the data you still want it available right?

you could set up an array with whatever language you are using and then at 14 cut it off and possible open a new window to complete the array. It just sounds way to complicated. BTW whats this for cuz im assuming if its data that people expect to be there then the scrolling issue shouldnt be a problem. Its like in excel files they have horizontal scolling but ive never heard a complain that they exist.

Sometimes the Answer You Are LOOKING for can be FOUND BY SEARCHING THE FAQ'S @&%$*#!!!
 
Unnecessary horizontal scrolling seems to be a bug in IE6. I have found if you omit the doctype tag in the offending frames, then scrolling auto works ok.

Clive
 
CliveC, depending on the doctype tag you are omitting you are just switching IE from standards-compliant mode (good) to quirks mode (bad).

It may look ok in IE quirks mode, but it is much less likely to look the same in non-IE than an equivalent standards-compliant page.

You're kind of advocating the opposite of what Zeldman says in Fix Your Site With the Right DOCTYPE!
(
Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Thanks everyone for your feedbacks. I have tried most of the things that are mentioned here, most of them before posting the code but that didn't seem to fix the problem. Am I suppose to assume that this cannot be done??????
 
&quot;Am I suppose to assume that this cannot be done??????&quot;

Unless I'm misunderstanding your problem, yes!

You've got some kind of dynamic system returning results of varying widths. Sometimes that width is greater than the user's browser - in which case you get a scroll bar. How do you expect the document to magically fit into the browser after all?

I suppose, if you really worked at it, you could write some script that would re-size the text to make it small enough to fit; but if you had lots of columns it might be too small to read. I'd rather have a scrolling table I could read than a non-scrolling one that I couldn't.

Don't worry about it. Like Deecee says, scrolling is normal for Excel with big tables of data. If your results are similar kinds of things then it should be OK.

-- Chris Hunt
 
clarkin, I am familiar with the link that you posted and do not disagree with you. It is just that it is the only fix that I have found.

I find that well over 90% of my visitors use IE and therefore I like to use colored scrollbars (an ie only feature). However coding the doctype defeats this.

ChrisHunt, The original problem was that when a vertical scroll bar is triggered, an unecessary horizontal bar also appears to accomodate the width of the vertical scrollbar.

Clive
 
CliveC said:
The original problem was that when a vertical scroll bar is triggered, an unecessary horizontal bar also appears to accomodate the width of the vertical scrollbar.

If anyone has found a solution to this could they point me to it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top