Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / padding between cells in the home page

padding between cells in the home page

Views: 1,247

Results 1 to 20 of 24
31 Dec 2010, 1:44 PM
#1
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

padding between cells in the home page

Hi,

v.1.39H

I have the categories in a single column home display, in a two column fashion, I added border to the .categoryListBoxContents, and it pushed the second column into the next row, thus I reduced the 50% column width following this:
http://www.zen-cart.com/forum/showthread.php?t=63814
which worked fine as the second column is now on the same row.

Problem is the two categories are attached to each other, and I'd like to add a little bit padding in between.

How can I do that?

Thank you.

31 Dec 2010, 1:49 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: padding between cells in the home page

As this can be template dependant
Where is your install

31 Dec 2010, 2:05 PM
#3
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

Sorry forgot to give link to page:
amber precious

31 Dec 2010, 2:07 PM
#4
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

I am using the basic template modified by me.

31 Dec 2010, 2:17 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: padding between cells in the home page

You can try removing the border you currently have and adding this to the bottom of your stylesheet and see if you like it

.categoryListBoxContents img{
	border: 1px solid #000;
        padding: 1em 5em 1em 5em;
	}
31 Dec 2010, 2:21 PM
#6
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

I'll try it right now, but doesn't that just wrap the image letting the text out?

31 Dec 2010, 2:23 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: padding between cells in the home page

that just wrap the image letting the text out?
Yes and why I stated see if you like it

31 Dec 2010, 2:24 PM
#8
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

Thanks, I tried it, and indeed it wraps the image only, as I'd like to have both image, and text as a box.

31 Dec 2010, 2:26 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: padding between cells in the home page

The way that the space is divided up there is not enogh space to add padding or margins without forcing it to another row
You could try changing the floor to make it say 25 or so percent and pad the boxes

31 Dec 2010, 2:29 PM
#10
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

Do you mean making the change here:

includes/modules/CUSTOM/category_row.php

25 $col_width = floor(100/$num_categories) -1;
26 } else {
27 $col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW) -1;
28 }

if yes, shall I change the 100, or the -1 value?

31 Dec 2010, 3:03 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: padding between cells in the home page

That would be the place. There are any number of ways to adjust the calculation - any way that works for your situation is fine.

31 Dec 2010, 3:11 PM
#12
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

Thank you both.
I'll play with it.

31 Dec 2010, 3:38 PM
#13
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

I tried reducing the width, and added padding (CSS), but the two cells (columns) stay attached, the padding appears to see the two cells as one.

the right border of left column sticks to the left border of the right column!

What part of the code controls the table padding?

31 Dec 2010, 3:43 PM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: padding between cells in the home page

I still see the width at 49% - - not enough space for margins or padding

Try

$col_width = floor(100/$num_categories) -10;
31 Dec 2010, 3:50 PM
#15
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

I turned it back to that value, after I tried both

$col_width = floor(100/$num_categories) -10;
and
$col_width = floor(80/$num_categories);

I'll put it up again with the
.categoryListBoxContents {
border: 1px solid #000;
padding: 5px;
}
so you can check.

Give me 2 minutes please.

31 Dec 2010, 4:00 PM
#16
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

I'm trying it on another install with 4 categories, and while the columns stick together, the rows are parted fine.
Here is the other install afz design

31 Dec 2010, 4:37 PM
#17
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

Going home now, will be back jan 3/4.

Meanwhile best wishes for 2011 to all.

3 Jan 2011, 2:03 PM
#18
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

I'm back ... still need help.

4 Jan 2011, 3:12 PM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: padding between cells in the home page

You have no horizontal margins for .categoryListBoxContents. Add to the bottom of your stylesheet

.categoryListBoxContents {
margin: 1em 0.9em;
}

4 Jan 2011, 3:20 PM
#20
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: padding between cells in the home page

Thank you for the prompt reply.
I had tried that using px, maybe I mistyped, I'll try again, and let you know.