[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

css add class & extra padding to one php template

Posted on 2011-04-29
10
Medium Priority
?
269 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

0
Comment
Question by:carolsanjose
  • 5
  • 4
10 Comments
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 35492755
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>
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 35492844
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 ...
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 35492868
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:carolsanjose
ID: 35493581
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

0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 35493639
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
0
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 2000 total points
ID: 35493692
If you wnat center the text try this:

<?php echo "

<tr>

      <td></td>
      <td style='vertical-align: middle;text-align: center;' colspan='5'><h3 class='error cart_empty'>$data[cart_empty]</h3></td>
      <td style='vertical-align: middle;text-align: center;'><a class='cartActionBtn start_shop' href='$_SESSION[cPage]'>$data[start_shopping]</a></td>

</tr>
"; ?>
0
 

Author Comment

by:carolsanjose
ID: 35493702
Thanks....for helping!

See the attached screenshot. Where you see red is what I am describing above.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 35493727
Why don't you simply decrease tha table width by 120px giving it the appropriate left value?
0
 

Author Comment

by:carolsanjose
ID: 35493843
Good idea...I am fixing it right now. I'll get back to you shortly.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question