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 09-08-2012, 12:12 AM   PM User | #1
Nickriggi
New Coder

 
Join Date: Sep 2012
Location: Ohio, United States
Posts: 14
Thanks: 3
Thanked 1 Time in 1 Post
Nickriggi is an unknown quantity at this point
Exclamation Help with table spacing!

I'm trying to put space in between each row of my table, but I can't out of to do it. This is the page: http://nickriggi.com/workwanted/

Code:
<table align="center" border="1" cellspacing="1" cellpadding="1">
	<tr>
		<th width="10%">Posted</th>
		<th width="20%">Title</th>
		<th width="20%">Location</th>
		<th>User</th>
	</tr>
        <?php
		$result = mysqli_query($cnx, "SELECT * FROM jobs ORDER BY id DESC");
		while($row = mysqli_fetch_array($result)){
			echo("<tr><td>".$row['date']."</td><td>".$row['title']."</td><td>".ucfirst($row['city']).",&nbsp;".$row['state']."<td>".ucfirst($row['username'])."</td></tr>");
		}
		mysqli_free_result($result);
	?>
</table>
Nickriggi is offline   Reply With Quote
Old 09-08-2012, 12:16 AM   PM User | #2
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
You cannot.

A table is a table. There are no spaces between rows in a table.

You can wrap the <tr>'s in <tbody>'s and use margin-bottom on them.

Code:
<table align="center" border="1" cellspacing="1" cellpadding="1">
    <tbody style="margin-bottom:20px;">
         <tr>
             <th>Month</th>
             <th>Savings</th>
         </tr>
    </tbody>
    <tbody style="margin-bottom:20px;">
         <tr>
             <th>Month</th>
             <th>Savings</th>
         </tr>
    </tbody>
</table>

Last edited by Sammy12; 09-08-2012 at 12:24 AM..
Sammy12 is offline   Reply With Quote
Old 09-08-2012, 12:20 AM   PM User | #3
Nickriggi
New Coder

 
Join Date: Sep 2012
Location: Ohio, United States
Posts: 14
Thanks: 3
Thanked 1 Time in 1 Post
Nickriggi is an unknown quantity at this point
Can I add an <hr /> tag in between each row? I can just take the border away and do that then, if there is a way.
Nickriggi 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 09:29 PM.


Advertisement
Log in to turn off these ads.