SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    m
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry problem with a cell's height

    I made a table using dreamweaver 4,

    I have splited it into two rows, and i want the height of the first row to be about 10px, so i define the height as 10, but it isn't!!!!

    it looks like a 40px, and i can only make it larger


    what do i do?!?!


    thanks

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there something inside like an image, or a cell in the row that has a height of 40px or so?
    And could you post your code, it might be we see something in there that might be causing the problem.

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    m
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found out now that it's the cell padding which is 9px,

    here is the code:

    <html>
    <head>
    <title>bla</title>
    </head>
    <body bgcolor="#FFFFFF" text="#000000">

    <table width="95%" border="0" cellspacing="0" cellpadding="9">
    <tr bgcolor="#0033FF">
    <td colspan="2" height="15">k</td>
    </tr>
    <tr>
    <td width="30%" valign="top">
    <p><a href="2.shtml">2</a></p>
    </td>
    <td width="70%" valign="top">
    <p><a href="1.shtml">1</a></p>

    </td>
    </tr>
    </table>
    </body>
    </html>


    I want the first row, to be at 15px height,
    while the row below it, splited into two cells, would have padding of 9px

    how can i do it?

    thanks

  4. #4
    SitePoint Zealot yuri's Avatar
    Join Date
    Oct 2001
    Location
    Just Round The Corner!
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    i'll do it now

    hang on about 10 mins and i'll see wot i can do

    chris

  5. #5
    SitePoint Zealot yuri's Avatar
    Join Date
    Oct 2001
    Location
    Just Round The Corner!
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    right ok. here we go. wot i did was insert tables into each of the cells and formatted as necessary. if this isnt what u are looking for, then give us a bell.


    <html>
    <head>
    <title>bla</title>
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
    <tr bgcolor="#0033FF">
    <td colspan="2"><table width="100%" height="15" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td width="30%"><table width="100%" border="0" cellspacing="0" cellpadding="9">
    <tr>
    <td><p><a href="2.shtml">2</a></p></td>
    </tr>
    </table></td>
    <td width="70%"><table width="100%" border="0" cellspacing="0" cellpadding="9">
    <tr>
    <td><p><a href="1.shtml">1</a></p></td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>




    chris

  6. #6
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i wouldn't nest tables for something so simple.. just split them into to.. that way the browser has less code to read PLUS you have less of a chance in messing up with some tag becuase of all the confusing code to deal with

    Code:
    <table width="95%" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td height="15"></td>
    	</tr>
    </table>
    
    <table width="95%" border="0" cellpadding="9" cellspacing="0">
    	<tr>
    		<td width="50%"></td>
    		<td width="50%"></td>
    	</tr>
    </table>
    try it, i think you'll like it
    just make sure if you align on talble to the center you do that to both of them.

  7. #7
    SitePoint Zealot yuri's Avatar
    Join Date
    Oct 2001
    Location
    Just Round The Corner!
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or you could do it like that ^----- lol

    chris

  8. #8
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One of the main reasons why you're having problems with the height attribute in a TD is because it's been deprecated:
    http://www.w3.org/TR/html401/struct/....html#h-11.2.6

    If you really want to force a TD to be a certain height then either put something inside the TD that is exactly that height or use CSS to set the height:

    td.height { height: 15px; }

    <td class="height">
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •