We help IT Professionals succeed at work.
Get Started

Add a little space on either side of a table.

breeze351 asked
Last Modified: 2017-04-09
I have some code that works Ok, but now they want a little space on the left and right.  I've tried several solutions and I can't figure out what the code needs to be. Does the total of the table columns have to be less than 100%?

Here's the code:
<table id= "Three_Line_Display" style="margin-left: 5px auto; margin-right: 5px auto;" border="0" cellspacing="0" cellpadding="0">
		// Create table header
		echo "<tr>";	
		echo '<td width = 20% class="Body_Labels" align="left">Address</td>';
		echo '<td width = 25% class="Body_Labels" align="left">Contact</td>';
		echo '<td width = 9% class="Body_Labels" align="center">Size</td>';
		echo '<td width = 9% class="Body_Labels" align="center">Rental</td>';
		echo '<td width = 12% class="Body_Labels" style="padding-left: 10px" align = "left">Possession</td>';		
		echo '<td width = 13% class="Body_Labels" style="padding-left: 10px" align = "left">Term</td>';
		echo '<td width = 8% class="Body_Labels" style="padding-left: 10px" align = "left">List/Update</td>';
		echo '<td width = 14% class="Body_Labels" align="center">Image</td>';
		echo '</tr>';
		// End Table Header 	

Open in new window

Watch Question
Most Valuable Expert 2017
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE