Gossamer Forum
Home : Products : Links 2.0 : Discussions :

HOW do I put cateogories in cells?

Quote Reply
HOW do I put cateogories in cells?
I still have a problem making categories (the index page) look the way I want it to.

I would like to put each category in a cell of its own and maybe also have the discription also in a cell of its own..

does anybody know how thats done? is it possible..

I would really like to hear about it.

Thanks.

Frank
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
I will look into that tomorrow.

another thing - I saw somewhere about making three columns instead of the default two. I have very short category names and alot of them so it would really be batter if i could have three columns.

I can play around with html but not very good at modifying the script --

help would be great!

thanks,
Frank
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
As all the categories are printed from the single <%category%> tag, I doubt it's possible to put them each in their own cell.

I got mine looking the way I wanted by editing the site_html.pl file. The table in which the categories appear is set at 80% in site_html.pl. But, of course, if your categories are going to be in a table cell to begin with (I like moderately nested tables), you'll probably want to set that to 100% so that they'll have plenty of space to spread out across the cell in which you want them to appear. That cell will no doubt have a set pixel width -- you want to use all of it to preserve your layout.

You can also change the font properties in site_html.pl. Changing them in a template (if you use templates) won't get the job done.

[This message has been edited by ChanFan (edited May 19, 1999).]
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
The same subroutine (sub site_html_print_cat) that is in site_html.pl is also in site_html_templates.pl so, anything you can do in one, you can do identically in the other. What ever you do to the cells in site_html_template.pl will show up in the <%category%> links_tag.

I hope this hopes.
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
The same subroutine has the instructions currently used to display the categories in two columns. There have been ongoing discussions previously concerning how to change that to 3 columns. A search of the forums indicates a good thread to look at is http://www.gossamer-threads.com/...um3/HTML/001487.html

I hope this helps.
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
Frank, I have the same problem as you, except that some of my categories are short (without descriptions ..like a,b,c,d type of things), while some are with descriptions.
I'm most interested in learning the answer to your situation though.
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
Thanks, Bobsie

I followed the link above and it was a great help. I almost got it looking just the way i wanted it to.

Here is what I did -

--
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+4) / 4);
--
if ($i == $half) {
$output .= qq|</td><td class="catlist" valign="top" width="100">\n|;
$i = 0;
}
$i++;

----

The above works fine and makes the 4 columns - BUT the first two columns are too close to each other and the others are spaced out ok.

I problem I found was that the first column does not have a width defined. the others have the above value but the first column doesn't so the second moves as close as possivle to the first..

Is there any way to make the first column behave like the rest??

thanks for your help so far..

Cheers,
Frank



[This message has been edited by FLThiak (edited May 19, 1999).]
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
The table itself, by default, uses 80% of the screen width. Since you are using 4 columns, each table data cell (<td> ) should have a width of 25%, not 100 pixels as you show. Look for and change:

Quote:
# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

to read:

Quote:
# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top" width="25%">\n|;

Then change your other code to have each cell width be 25% and you should have what you want. The neat thing is, no matter what resolution a browser is set for, using percentages for the widths allows the browser to show the category list the same basic way.

I hope this helps.

[This message has been edited by Bobsie (edited May 20, 1999).]
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
I think Bobsie meant to say set the table width at 100%. Then four columns with cell tags set at 25% would all be spaced the same. Smile
Quote Reply
Re: HOW do I put cateogories in cells? In reply to
     
Quote:
I think Bobsie meant to say set the table width at 100%. Then four columns with cell tags set at 25% would all be spaced the same.

No, Bobsie said what he meant to say. If you set the table to 100% width, then it will not leave room for anything else that may be desired on the left or right side of the table. If it is set to 80%, then 20% of the screen on the right or left (or 10% on both sides), depending on how the table is aligned, is available for other HTML code.

The <td> cells being set to a width of 25% refers to the table width available, not the screen width. That is why using percentages are so useful versus specifying a set pixel width. So, each cell would be 25% of the 80% available, or 20% of the total screen width.

One of my mottos is: Say what you mean but mean what you say.

If you have a question about something I said, then feel free to ask it. I will be glad to provide any clarification. If you see a glaring error I have made (and I do make them from time to time), please do point it out to me and I will correct it. However, please do not attempt to speak FOR me. Everything I write about is based on some experiences that I have had and I definitely have a lot of experience with setting up categories (and links) in table data cells.

Thanks.

[This message has been edited by Bobsie (edited May 20, 1999).]