Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding space in between items

Adding space in between items

Locked

Views: 3,320

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
11 May 2007, 5:56 AM
#1
cowgirl32 avatar

cowgirl32

New Zenner

Join Date:
Apr 2007
Posts:
8
Plugin Contributions:
0

Adding space in between items

my product images are really close together. I would like to add some white space between them. Where would I do this?? Is is possiable?

11 May 2007, 6:01 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding space in between items

In your stylesheet (/includes/templates/your_template/css/stylesheet.css), add

/* space & border between listing items */
.productListing-odd td, .productListing-even td {
text-align: left;
vertical-align: top;
padding:0.5em;
margin-bottom: 1em;
border-bottom: 3px double #aaccbb;
}

Change numbers, add, edit or delete properties as desired.

11 May 2007, 6:21 AM
#3
cowgirl32 avatar

cowgirl32

New Zenner

Join Date:
Apr 2007
Posts:
8
Plugin Contributions:
0

Re: Adding space in between items

thank you, that worked wonderfully.

12 May 2007, 10:58 AM
#4
saagark avatar

saagark

New Zenner

Join Date:
May 2007
Posts:
1
Plugin Contributions:
0

Re: Adding space in between items

gjh42:

In your stylesheet (/includes/templates/your_template/css/stylesheet.css), add

/* space & border between listing items */
.productListing-odd td, .productListing-even td {
text-align: left;
vertical-align: top;
padding:0.5em;
margin-bottom: 1em;
border-bottom: 3px double #aaccbb;
}

Change numbers, add, edit or delete properties as desired.

This works ideally. But as All Products uses the same classes .productListing-odd & -even, the border shows surrounding the description. Is there any way to only add the border to the product listing?

Thanks!

12 May 2007, 3:49 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding space in between items

Change the selectors to

#indexProductList .productListing-odd td, #indexProductList .productListing-even td

and it will only affect categoriy listings.

14 May 2007, 7:07 AM
#6
metootech avatar

metootech

New Zenner

Join Date:
May 2007
Posts:
19
Plugin Contributions:
0

Re: Adding space in between items

Thanks everybody for the helpful info....
Uh, what I had more in mind for spacing is like this page in the Wallet template.... what CSS code does this setup? ....METOOTECH

http://(sorry, site offline)/137/index.php?main_page=index&cPath=23&zenid=80b29ee4c414f2fbf8146f6be279be17

14 May 2007, 7:10 AM
#7
metootech avatar

metootech

New Zenner

Join Date:
May 2007
Posts:
19
Plugin Contributions:
0

Re: Adding space in between items

I forgot to add in the last post, how is the background color change on every other listing done? METOOTECH

14 May 2007, 7:41 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding space in between items

The code automatically adds tags for productListing-odd and productListing-even, so all you have to do is style those in your stylesheet:

.productListing-odd {background-color: #ccddff;}
.productListing-even{background-color: #ffffff;}

14 May 2007, 4:18 PM
#9
metootech avatar

metootech

New Zenner

Join Date:
May 2007
Posts:
19
Plugin Contributions:
0

Re: Adding space in between items

Thanks for the info Glenn... where should these codes be added to the style sheet? How should the background code above be added to the code at the top of this thread ? METOOTECH

14 May 2007, 6:17 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding space in between items

Put these two lines in as is, not inside something else. For convenience, you can find the other productListing* declarations and put these in the same area.

30 May 2007, 5:01 PM
#11
kiamyka avatar

kiamyka

New Zenner

Join Date:
May 2007
Location:
Yorkshire UK
Posts:
47
Plugin Contributions:
0

Re: Adding space in between items

Glenn thanks for this I have been trying to work this out for ages
chrisx

5 Jul 2007, 11:03 PM
#12
gsis avatar

gsis

Zen Follower

Join Date:
Jun 2007
Posts:
140
Plugin Contributions:
0

Re: Adding space in between items

Thanks, from a CSS *and *Zen Cart newbie.

Worked a treat for my site! :thumbsup:

23 Jul 2007, 11:26 PM
#13
storybook avatar

storybook

New Zenner

Join Date:
Jun 2007
Location:
Wagener, SC
Posts:
27
Plugin Contributions:
0

Re: Adding space in between items

I was pointed to this thread just moments after figuring out another way to approach this problem...

This is what I did:
http://www.zen-cart.com/forum/showthread.php?t=71275

Is there a "which is better" issue here?

StoryBook

24 Jul 2007, 7:36 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding space in between items

To some extent, each method is equally easy and certainly effective.
Editing tpl_tabular_display.php does mean that there is another file to manage during upgrades, and as Kim pointed out, it affects everything that uses it. That might indeed be fine, but I know that tpl_columnar_display is used for additional images in the product info page as well as elsewhere, so a tweak I needed for that had to be wrapped in a conditional statement to only execute there; I don't know for sure whether tpl_tabular_display is used anywhere beside the listings.

You noted using <td colspan="3"><hr /></td>, which I presume fits with three items you have displayed in product listings; but if you decide to have four items in listings, you would need to re-edit the file.

The stylesheet method covers any variation without special adjustment. Also, if you want anything beside the standard hr color/style/thickness, you would need to make a special declaration in the stylesheet anyway.

25 Jul 2007, 2:23 AM
#15
cookie30 avatar

cookie30

New Zenner

Join Date:
Jul 2007
Posts:
15
Plugin Contributions:
0

Re: Adding space in between items

Hi, I would like to know how to make 3 items picture across the page please? My specials and new listings etc are showing this way but my products are down the page and all squashed. Can I make them display accross the page as the special are?
Thanks Kylie