Results 1 to 3 of 3

Thread: Table Always on top

  1. #1
    Join Date
    Apr 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Table Always on top

    Is there a way that I can have a table on a page that always hovers on top of the window?

    I tried using a few scripts I found in the navigation area of DD, but I couldn't get them to look the way I want them.

    This is what my table script looks like...

    Code:
    <table  onMouseover="changeto(event, 'images/navbarhov.png')" onMouseout="changeback(event, 'images/navbar.png')" border="0" width="100%" id="table1" style="border-collapse: collapse; background-image: url('images/navbar.png'); background-repeat: repeat-x; position:absolute; left:0px; top:0px; width:792px" height="32" style='position:absolute;top:0;left:0;'>
    Looks and works great, the only thing I want to do now is have it horizontally centered, and have it static to the top of the page, so when the user scrolls down the page, the table will still be visible at the top of the window as they scroll.

    Help would be highly appreciated. Thank you!

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You want to use position:fixed. Unfortunately, this doesn't work with IE, so you have to use one of various hacks. The most common is to put the whole page in a 100%x100% scrolling DIV, then have the table absolutely positioned outside of it.

    Centring it is as easy as left:40%; or similar. It won't be perfect in all browsers and resolutions, but with a little tweaking, you can get it close enough.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    Thank you for your suggestion, however, I can't get it to work the way I want. 100% height and width, doesn't do anything, so I dropped the height to 94%. That worked, but the width doesn't seem like it's actually covering 100% of the window.

    I also at one point ended up with two scroll bars. I don't want that.

    There is a floating menu javascript that I found...

    http://www.dynamicdrive.com/dynamicindex1/sm/index.htm

    It's almost like what I am trying to accomplish, but I want to make my own table with links and images in there, but I don't know java script, so I don't know how to edit it to use my table instead of what it defaults to.

    Any suggestions on this possibillity?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •