SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Montreal
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Tables: can't make a TD less than 20px in height

    I'm trying to make a td with a height of 12px, now it seems like a td won't go under 20px of height, here's my code:

    <td colspan="2" style="height:12px; background:url('images/divide.gif');">&nbsp;</td>

    Is there any way I can make this td with a height of 12px?

  2. #2
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    in IE? try to set font-size to 0px
    <td colspan="2" style="font-size:0px;height:12px; background:url('images/divide.gif');">&nbsp;</td>

  3. #3
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I've just used Screen Calipers on some quickly created tables, and it's not just <th>, it's a table thing. As text size in IE is altered the table takes on a minumum height. With no font size stated, it is 20px at normal (medium) text size and descreases to 16px at smallest, increasing of course when set to largest (to 25px) with or without a <th> .

  4. #4
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by all4nerds
    Hello

    in IE? try to set font-size to 0px
    <td colspan="2" style="font-size:0px;height:12px; background:url('images/divide.gif');">&nbsp;</td>
    Because it is an empty cell, you get a default height...table height and cell height are invalid, so you should try and specify the height via css.

    the oldes, quickest (and dirtiest trick is to prop the cell open at the exact size using a transparent shim.

    Nadia

  5. #5
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps give this a try.

    <td colspan="2" style="height:12px; background:url('images/divide.gif'); overflow: auto;">&nbsp;</td>

  6. #6
    SitePoint Member
    Join Date
    May 2001
    Location
    Zwolle, Netherlands
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe you should remove the: &nbsp;


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
  •