SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast Fuseblown's Avatar
    Join Date
    Jul 2001
    Location
    State College, PA
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    This may be a little weird...

    Okay, here's what I wanna do...

    You know how you can set a table to 100% to make it change width depending on the browser size, screen resolution, etc., right?

    Well I want to be able to center a table on the screen vertically depending on those settings as well.

    Is this possible? Or do I just have to move it down a couple of spaces and hope for the best? Doesn't have to be regular HTML tags or anything I'm basically looking for something to do it that isn't Flash (which I can do it in since the size of the Flash file is set).

    Or will I just have to setup some kind of autodetect to grab the visitor's resolution and have it choose a file based on that?

    I appreciate all help.
    Fuseblown

  2. #2
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, you can do that very easily. I asked the same question just a little while ago. Here's the thread, you'll find the answer there:

    http://www.sitepointforums.com/showt...threadid=27865

    Good luck!

    BTW, if you don't want to read up on it, here's the code:

    <table width="100%" height="100%">
    <tr>
    <td align="center" valign="middle">

    <table><tr><td>
    This is the main table.
    </td></tr></table>

    </td>
    </tr>
    </table>
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    easy enough. Create a table with width and height set to 100%.

    Inside that, create another table with your site contained in it aligned horiz to center and vertically to middle. Try this code.
    Code:
    <TABLE WIDTH="100%" HEIGHT="100%" BORDER="1" CELLSPACING="0" CELLPADDING="0">
      <TR>
        <TD>
          <TABLE WIDTH="100%" BORDER="1" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" VALIGN="middle">
            <TR>
              <TD>&nbsp;</TD>
            </TR>
          </TABLE>
        </TD>
      </TR>
    </TABLE>
    Incidentally, you could use CSS to define an absolute position for your site. Actually, this is the W3C standard, but not completely supported if I'm not mistaken.

    Sketch
    Aaron Brazell
    Technosailor



  4. #4
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Sketch
    Code:
    <TABLE WIDTH="100%" HEIGHT="100%" BORDER="1" CELLSPACING="0" CELLPADDING="0">
      <TR>
        <TD>
          <TABLE WIDTH="100%" BORDER="1" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" VALIGN="middle">
            <TR>
              <TD>&nbsp;</TD>
            </TR>
          </TABLE>
        </TD>
      </TR>
    </TABLE>
    you're a little off sketch, the <align="center" valign="middle"> goes in the outer table, this way the inner table is completely centered.
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  5. #5
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah, yes. Thanks Swimm. mixed that up.

    Sketch
    Aaron Brazell
    Technosailor



  6. #6
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Sketch
    ah, yes. Thanks Swimm. mixed that up.

    Sketch
    Not a problem
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  7. #7
    SitePoint Enthusiast Fuseblown's Avatar
    Join Date
    Jul 2001
    Location
    State College, PA
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone, I shoulda known that one, heh.
    Fuseblown

  8. #8
    SitePoint Enthusiast Fuseblown's Avatar
    Join Date
    Jul 2001
    Location
    State College, PA
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The result

    Thanks once again,
    http://www.spacemyte.com/new/
    Fuseblown


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
  •