Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-13-2009, 03:32 PM   PM User | #1
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,513
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Why does this margin not work ?

Hi

I have a table of data and I want to have a gap between each row.

So I se the above and below margins of the rows to 40px.

But all the rows are tightly together.

What have I done wrong ?

Here is the code :

Code:
<table summary="web hosts" width="800px">
<tr style = \"margin: 40px 0 40px 0 ;\">
<th> </th><th>Host</th><th>Special Price</th><th>12 Month</th><th>Domains</th><th>Space</th><th>Free Domains</th><th>Full Details</th>
</tr>
<?php 
	while($row = mysql_fetch_assoc($result)){
    extract($row);
  	$pix = "/im/aff_images/$ad_pict";
  	$cnt = $row['click_cnt'] +1;
echo "
<tr style = \"margin: 40px 0 40px 0 ;\">
<td><b>$rank</b></td>
<td><a href=\"/im/linker.php?a=$advert_id&amp;b=$ad_link&amp;c=$cnt\" target=\"_blank\"><img src=\"$pix\" alt='Host Logo'height='34' width='150' border=0></a></td>
<td>$data1</td>
<td>$data2</td>
<td>$data3</td>
<td>$data4</td>
<td>$data5</td>
<td><a href=\"/im/linker.php?a=$advert_id&amp;b=$ad_link&amp;c=$cnt\" target=\"_blank\">$ad_name</a></td>
</tr>";
		}  // end while
?>
</table>
Any ideas ?
jeddi is offline   Reply With Quote
Old 02-13-2009, 04:48 PM   PM User | #2
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,042
Thanks: 9
Thanked 81 Times in 81 Posts
jerry62704 is on a distinguished road
Try this in your css:
td {padding-bottom: 40px;}

I don't think you need to escape the quote in the <tr> as it isn't part of the PHP. You do realize that the 40 top would eat the 40 bottom with collapse?
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

Last edited by jerry62704; 02-13-2009 at 04:59 PM..
jerry62704 is offline   Reply With Quote
Old 02-15-2009, 12:20 PM   PM User | #3
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,513
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Quote:
You do realize that the 40 top would eat the 40 bottom with collapse?
I didn't code any collapse, did I?
jeddi is offline   Reply With Quote
Old 02-15-2009, 12:38 PM   PM User | #4
snowieken
Regular Coder

 
Join Date: Nov 2004
Location: The land of chocolate
Posts: 226
Thanks: 1
Thanked 16 Times in 16 Posts
snowieken is on a distinguished road
Margins don't work on a table row, you need to do a workaround with your table cells somehow to achieve the desired effect. That, or cellspacing/cellpadding in your table - but this goes for the entire table then, which is probably not your intention.
__________________
-Snow

Susie, if you want to see your doll again, leave $100 in this envelope by the tree out front. Do NOT call the police. You CANNOT trace us. You CANNOT find us.

Sincerely,
- Calvin.
snowieken is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:41 PM.


Advertisement
Log in to turn off these ads.