forcing horizontal div scrolling

Discussion in 'HTML' started by King of Red Lions, May 26, 2005.

  1. Hi, i have a blog and every new post appears in a <td> within a table.
    This table is contained within a <div> and I was wondering if there was
    anyway of forcing the <div> to scroll side horizontaly! This would help
    as my blog displays the 8 newest posts. Many thanks in advance!
    King of Red Lions, May 26, 2005
    #1
    1. Advertising

  2. "King of Red Lions" <thaynes/no_spam/@gawab.com> wrote in message
    news:d744em$d1k$...
    > Hi, i have a blog and every new post appears in a <td> within a table.
    > This table is contained within a <div> and I was wondering if there was
    > anyway of forcing the <div> to scroll side horizontaly! This would help
    > as my blog displays the 8 newest posts. Many thanks in advance!


    You can us CSS to achieve (more or less) what you are after.

    First you need to give your div a class

    <div class="scroller"><table> ........ </table></div>

    Then in the head have the following code:

    <style type="text/css"><!--

    div.scroller {
    height: 75px;
    width: 200px;
    overflow: auto;
    }

    div.scroller table {
    height: 55px;
    margin: 0;
    }

    //--></style>


    The dimensions of the div will be fixed at 75x200px. If the table is larger
    than that the div will sroll in which ever direction it needs to.

    If the table (plus scroll bar) is less high than the div, but wider then it
    will scroll horizontally.

    I've made the height of the table small enough to allow for the scroll bar.

    Hope this helps.

    --
    Richard Quick
    http://www.chocolatemagazine.co.uk
    Richard Quick, May 26, 2005
    #2
    1. Advertising

  3. In article <d744em$d1k$>,
    King of Red Lions <thaynes/no_spam/@gawab.com> wrote:

    > Hi, i have a blog and every new post appears in a <td> within a table.
    > This table is contained within a <div> and I was wondering if there was
    > anyway of forcing the <div> to scroll side horizontaly! This would help
    > as my blog displays the 8 newest posts. Many thanks in advance!


    I was always taught that horizontal scrolling == 'bad'. I believed it
    when I surfed the net at 640x480 until a couple of months ago. Now I
    think that tables == 'bad' with my much higher resolution and most
    tables fixed to a resolution much smaller. Can't you dump the table
    layout and go for any-size-design? I realize that most Perl and PHP
    books love to show you how to dump vars in a table cell. But it doesn't
    need to be that way.

    leo

    --
    <http://web0.greatbasin.net/~leo/
    Leonard Blaisdell, May 27, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Just D.

    Horizontal Scrolling

    Just D., Feb 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    403
    Just D.
    Feb 14, 2005
  2. Just D.

    Disable horizontal scrolling

    Just D., Feb 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,901
    Just D.
    Feb 17, 2005
  3. =?Utf-8?B?RWR1YXJk?=

    DIV Horizontal Scrolling Very Slow

    =?Utf-8?B?RWR1YXJk?=, Jan 25, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    2,007
    =?Utf-8?B?RWR1YXJk?=
    Jan 25, 2006
  4. stan
    Replies:
    0
    Views:
    444
  5. Tom Szabo

    Style on Div to avoid horizontal scrolling

    Tom Szabo, Dec 14, 2004, in forum: Javascript
    Replies:
    5
    Views:
    124
    Thomas 'PointedEars' Lahn
    Jan 30, 2005
Loading...

Share This Page