SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist Caesar's Avatar
    Join Date
    May 2000
    Location
    On some harddisk
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    I've got a table with 2 columns. The left column with a proposed width of 150 and the right column with proposed width of 1. The code seems ok to me but the output seems totally wrong as the right column seems bigger than it is supposed to be.

    The page is at http://worldzone.net/technology/caesariv/left.htm

    Pls help tell me what's wrong !

  2. #2
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be worth adding table division cells in for the right hand column.

    For example:

    Code:
    <tr> 
    <td width="150" bgcolor="#000000" height="1">*</td>
    <td width="1" bgcolor="#000000" height="1"> </td>
    </tr>
    By only adding one division per row when there should be two, you're trusting the browser to think for itself which is NEVER a good idea!

    You might also want to set the cellspacing and cellpadding attributes to 0 to get rid of any extra spacing that way.

    Hope that helps a bit.

    Ady
    v-technologies - Freelance Goodness.

  3. #3
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eek, i'm a stoopid-head - to follow that course of action you'd need to get rid of:

    Code:
    <td rowspan="13" bgcolor="#336699" width="0">*</td>
    OR! Now that i've spotted the row spanning cell, set the with of that to 1 and take out the space, replacing it with &nbsp; - my theory being that the space character is actually wider than one pixel and that's defining the width of the row.

    That probably makes no sense, but i'm trying to eat a sandwich while i type this

    Ady
    v-technologies - Freelance Goodness.

  4. #4
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Fluffykins
    .... take out the space, replacing it with * - my theory being that the space character is actually wider than one pixel and that's defining the width of the row ...

    Ady
    Judging by my experiences in this, Ady is half right. I have found that the space does force a minimum WIDTH and HEIGHT of a Table Cell. However, replacing it with "&nbsp;" will make no difference since it has the exact same properties as a "normal" space.

    What you need to do is to create a "dummy" transparent gif image of 1 x 1 pixel in size. Replace the space with this gif using the <IMG> tag - being sure to specify HEIGHT and WIDTH attributes.

    Of course Ady's earlier comment about the CELLSPACING and CELLPADDING attributes being set to "0" are crucial!

    You can also refer to the inagural issue of Kevin Yank's SitePoint Tech Times where he discusses a similar situation much better than I can.

    Hope this helped. (I have not looked at your example URL or the source myself - I'm just talking from previous experience)

    Ady - trust you enjoyed the sandwich!

    [Edited by thespian on 11-13-2000 at 09:42 AM]
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  5. #5
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I was close

    Funny, I thought a non breaking space was different to a space character.

    It seems you learn something new every day! *sheepish look*

    Ady
    v-technologies - Freelance Goodness.

  6. #6
    SitePoint Evangelist Caesar's Avatar
    Join Date
    May 2000
    Location
    On some harddisk
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that helped. Thanks people esp Fluffykins !

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ady...

    a non-breaking space (&nbsp is identical to a regular space in it's attributes. It differs in that you cannot have more than one normal space in a row and expect to get that space in your output.

    &nbsp; allows you to get that extra space by putting more of them inline with each other.

    and yes...if you put a &nbsp; into a table cell to fill it, you will get a certain amount of space. If you want to avoid using the graphical solution that Thespian suggested (which I use ALL THE TIME!), then you can throw a font tag into that cell and say <font size="1">&nbsp;</font>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Don't forget that older versions of Netscape don't recognise empty table cells so it is always a good idea to have something in a cell, even if it is just a non-breaking space.


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
  •