SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: tables query

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tables query

    how can i create the effect in a table of it being flexible width (100%) but each outside cell being fixed at 1 pixel?

    ive tried nesting a 100% width table inside a 3 cell table with outer cells being 1 pixel width but the effect in a browser appears more like 3 pixels outside cells.

    any ideas?

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To accomplish this, you need to do two things. The first one is to create a general table layout like the one below:

    Code:
    <html>
    
    <head>
    <title>Table page</title>
    </head>
    
    <body marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0">
    
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td width="1"><img src="spacer.gif"></td>
    <td>Some text here... tralalalala....</td>
    <td width="1"><img src="spacer.gif"></td>
    </tr>
    </table>
    
    </body>
    
    </html>
    Second of all, as you might have noticed I referred to an image called spacer.gif. This image should be a 1x1 pixels transparent gif. This is the best way to get your table cell to be one pixel.

    If you have any questions about this, feel free to ask .


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
  •