SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    England
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prevent a cell expanding

    I have a table of the form:

    <table width="100%">
    <tr>
    <td width="10">a</td>
    <td>b</td>
    </tr>
    </table>

    I want the "a" cell to actually stay 10 pixels and not decide to just expand itself because b dosen't have a width set. I know there is the css tyle max-width but this is css2 and dosen't seem to work in IE.

    Any suggestions?

  2. #2
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The way you have it, cell "a" should stay at 10px and cell "b" should expand! At least it used to for me when I was doing tabled layouts.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    England
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,
    Oops,that wastn't the problem (I have a dynamically generated table here). Anyway, the problem appears to be this:

    <table width="100%" border="1">
    <tr>
    <td width="10">a</td>
    <td>b</td>
    </tr>
    <tr><td colspan="2">hkkhkhkkhhhkh</td></tr>
    </table>

    Dosen't do what I think it well, should do. I would like to just use <div> tags for all this stuff but unfortunatly right now I just can't for a number of reasons

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,269
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    This is why I hate tables. You will have to have some more content in the second cell then it displays correctly (about 10 - 15 charactres where you have the "b" ).

    Otherwsie you will probably have to use the dreaded spacer gif. This is how dw does it.
    Code:
      <table width="100%" border="1" cellpadding="0"  cellspacing="0"><!--DWLayoutTable-->
      <tr> 
    	<td width="10">a</td>
    	<td width="100%">0</td>
      </tr>
      <tr>
    	<td colspan="2">hkkhkhkkhhhkh</td>
      </tr>
      <tr><td height="3" style="border:none"><img src="spacer.gif" alt="" width="11" height="1"></td><td></td></tr>
    </table>
    But as I don't use tables anymore someone else may be able to correct me in this

    Paul

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    England
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for that. I am going to see if there is going to be a way to use <divs> instead of tables for this layout, probably not going to be easy

  6. #6
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    England
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looking into this more, I can't use divs for this table, it really is tabular data, not for design.


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
  •