2 replies [Last post]
waybck
Offline
newbie
Grimstad, Norway
Last seen: 15 years 21 weeks ago
Grimstad, Norway
Timezone: GMT+2
Joined: 2004-05-28
Posts: 2
Points: 0

Hi.

A section of the page I'm developing has a table within a fixed size div. The table fits the contatiner height, but is much wider, so I want horisontal scrolling.

However, the design doesn't look good with the vertical scrollbar present, even if it is shaded out as inactive. To solve this I used this css script :

overflow-y:hidden;overflow-x:auto;

...which works perfectly, but of course only in IE.

Is there a way to achive this in gecko (NN, Moz) and Opera as well ?

If not, is it possible to keep this feature in IE and have scrolling both vertical and horizontal in the other browsers without having to detect the browser with javascript and use different stylesheets ?

All help will be greatly appreciated : )

Eirik, Norway

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 6 days 16 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

Horizontal scrollbar only : Works in IE but nothing else...

Hi waybck,
With overflow-x and y are IE only.

By default other overflow is set to visible, change this to auto then browsers should only use them when needed.
Then after that statement use overflow-y:hidden;overflow-x:auto; for IE and you should get close to what your after.

Hope that helps

waybck
Offline
newbie
Grimstad, Norway
Last seen: 15 years 21 weeks ago
Grimstad, Norway
Timezone: GMT+2
Joined: 2004-05-28
Posts: 2
Points: 0

Horizontal scrollbar only : Works in IE but nothing else...

thanks fro the tip. didn't work though...

I fixed it with a css-hack that is used for hiding css on IE. Then I applied overflow:auto on just Opera, mozilla and NN.

the hack :

<style type="text/css">
div[id] {
overflow:scroll;
height:148px;
}
</style>

the div :

<div STYLE="overflow-y:hidden;overflow-x:auto;width:100%;" id="idSelector">

.....