We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

css add class & extra padding to one php template

carolsanjose
carolsanjose asked
on
Medium Priority
280 Views
Last Modified: 2012-05-11
I am trying to add 60px padding-left & padding-right to the table listed under the title Shopping Cart on this page:
http://66.147.244.225/~minimosa/?showCart=1&cPage=/~minimosa/

Tell me how to add the div style tag to the code below.  Thank you.

<?php echo "

<tr>

	<td></td>
	<td colspan='5'><h3 class='error cart_empty'>$data[cart_empty]</h3></td>
	<td><a class='cartActionBtn start_shop' href='$_SESSION[cPage]'>$data[start_shopping]</a></td>

</tr>

"; ?>

Open in new window

Comment
Watch Question

Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Try this:

<tr>

      <td></td>
      <td style='padding: 0 60px;' colspan='5'><h3 class='error cart_empty'>$data[cart_empty]</h3></td>
      <td style='padding: 0 60px;'><a class='cartActionBtn start_shop' href='$_SESSION[cPage]'>$data[start_shopping]</a></td>

</tr>
Most Valuable Expert 2011
Author of the Year 2014

Commented:
It might need to be more like this (top, right, bottom, left, like "clockwise")...

<td style='padding: 0 60px 0 60px;' colspan='5'><h3 class='error ...
Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Hi, Ray. AFAIK, in standard css if you use two values for those attributes that require top left right bottom values, the first value will be used for top and bottom values, the second one for left and right values. This works for margin attribute also.

Author

Commented:
I tried both ways & neither of them worked.  Right now, I updated the code usinge your code Marqus.  The page is not rendering the results I am looking for.  60px padding on the left & right.
http://66.147.244.225/~minimosa/?showCart=1&cPage=/~minimosa/ 

What else should I try?
<?php echo "

<tr>

      <td></td>
      <td style='padding: 0 60px;' colspan='5'><h3 class='error cart_empty'>$data[cart_empty]</h3></td>
      <td style='padding: 0 60px;'><a class='cartActionBtn start_shop' href='$_SESSION[cPage]'>$data[start_shopping]</a></td>

</tr>
"; ?>

Open in new window

Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Sorry, carolsanjose, but I see that the string "Your Shopping Cart Is Empty" is now more to right than before. Keep in mind that css rules not always do what you expect they do and this depends  by a lot of things. Can you explain what visual effect you wish to reach exactly? I think you probably wish to have the string vertical and horizontal centered in the available space... It's ?right
Freelancer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Thanks....for helping!

See the attached screenshot. Where you see red is what I am describing above.
Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Why don't you simply decrease tha table width by 120px giving it the appropriate left value?

Author

Commented:
Good idea...I am fixing it right now. I'll get back to you shortly.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.