Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Mar 2002
    Location
    Warwick!
    Posts
    735
    Member #
    37
    Code:
    <table border="1" width="400" height="200">
      <tr>
        <td width="20" > One </td>
        <td width="20" > Two </td>
        <td width="20" > Three </td>
        <td width="20" > Four </td>
        <td > Padding </td>
      </tr>
      <tr>
        <td colspan="5">Not much text!</td> 
        <!-- <td colspan="5">There is quite a lot of text here...and it messes up the table :(</td> -->
      </tr>
      <tr>
        <td colspan="5">Test</td>
      </tr>
    </table>
    Stick this code in an html file and view it...that is how is should look. The first four cells are small and the forth fills up the width.
    Now comment the first bold line and uncomment the second. Now the width of the cells on the first row are buggered WTH is happening?

    I am using IE 6 btw.
    I am non-committal, feigning blasť.

  2.  

  3. #2
    Member siyan's Avatar
    Join Date
    May 2002
    Location
    Yemen
    Posts
    42
    Member #
    111
    Code:
    <table border="1" width="400" height="200">
      <tr>
        <td width="20" > One </td>
        <td width="20" > Two </td>
        <td width="20" > Three </td>
        <td width="20" > Four </td>
        <td width="320"> Padding </td>
      </tr>
      <tr>
        <td colspan="5">Not much text!</td> 
    </tr>
      <tr>
        <td colspan="5">Test</td>
      </tr>
    </table>
    Worked for me. IE is sort of lame with tables I find...but NS is worse.

    -C
    meh.

  4. #3
    Senior Member
    Join Date
    Apr 2002
    Location
    Cocooned in her thoughts
    Posts
    312
    Member #
    67
    Liked
    3 times
    I think your problem is - using 20 as the cell width. When it displayes "One", "Two" etc. the width anyways exceeds 20 pixels. So using that width diktat prolly doesn't work.

    I assume your main problem is wanting the first row to have four equal sized, small cells first and then the last cell filling up the rest of the space, no matter what text is present in the other rows.

    I think you should try changing the width parameter to a %
    Here's what I did and it worked:

    Code:
    <table border="1" width="400" height="200">
      <tr>
        <td width="5%" > One </td>
        <td width="5%" > Two </td>
        <td width="5%" > Three </td>
        <td width="5%" > Four </td>
        <td > Padding </td>
      </tr>
      <tr>
        <td colspan="5">There is quite a lot of text here...and it messes up the table </td> 
      </tr>
      <tr>
        <td colspan="5">Test</td>
      </tr>
    </table>
    Code tag added -- Arien
    Don't look so frightened
    This is just a passing phase

    One of my bad days...

  5. #4
    Member siyan's Avatar
    Join Date
    May 2002
    Location
    Yemen
    Posts
    42
    Member #
    111
    Even if you set the table width smaller than the contents, IE *should* just shrink the cell to be as small as possible. But as we all know....

    -C
    meh.

  6. #5
    Senior Member
    Join Date
    Apr 2002
    Location
    Cocooned in her thoughts
    Posts
    312
    Member #
    67
    Liked
    3 times
    ?
    Are you saying that suppose I set the td width to 3 pixels, but then echo "AAAAA" (more than 3 pix wide) in the td, the resultant column will not be just as many pixels that "AAAAA" requires, but even more?
    Don't look so frightened
    This is just a passing phase

    One of my bad days...

  7. #6
    Member siyan's Avatar
    Join Date
    May 2002
    Location
    Yemen
    Posts
    42
    Member #
    111
    no, i'm saying that it should shrink to as small as AAAAA can be

    -C
    meh.

  8. #7
    Senior Member
    Join Date
    Apr 2002
    Location
    Cocooned in her thoughts
    Posts
    312
    Member #
    67
    Liked
    3 times
    Yeah that's what i meant to ask actually. So you're saying the td should shrink down to say 30 pixels exactly if each "A" occupies 6 pixels, for "AAAAA"?


    Well, I think it does! I never had a problem this way really. Do you have any code to demonstrate that? Whatis ur IE version?
    Don't look so frightened
    This is just a passing phase

    One of my bad days...

  9. #8
    Senior Member
    Join Date
    Mar 2002
    Location
    Warwick!
    Posts
    735
    Member #
    37
    Basically the first 4 need to autosize and the 5th to take up the rest....I fixed it using divs!
    I am non-committal, feigning blasť.

  10. #9
    Member siyan's Avatar
    Join Date
    May 2002
    Location
    Yemen
    Posts
    42
    Member #
    111
    Originally posted by thexchord
    Yeah that's what i meant to ask actually. So you're saying the td should shrink down to say 30 pixels exactly if each "A" occupies 6 pixels, for "AAAAA"?


    Well, I think it does! I never had a problem this way really. Do you have any code to demonstrate that? Whatis ur IE version?
    6.

    I thought it did too...but oh well. Weird.

    -C
    meh.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:06 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com