i use loops to display the category list for some reason, but anyway, how is it possible to display something from loops in 2 columns?
Sep 8, 2002, 12:12 PM
Veteran / Moderator (2199 posts)
Sep 8, 2002, 12:12 PM
Post #2 of 8
Views: 3467
Have a look at the following thread. It's not exactly what you want, but can easily change it to always display two columns (basically just replace
my @new_col_at = qw/5 10 20/;
with
my @new_col_at = qw/0/;
(or maybe it should be 1, instead of 0, you have to test this).
http://www.gossamer-threads.com/...rum.cgi?post=212197;
Ivan
-----
Iyengar Yoga Resources / GT Plugins
my @new_col_at = qw/5 10 20/;
with
my @new_col_at = qw/0/;
(or maybe it should be 1, instead of 0, you have to test this).
http://www.gossamer-threads.com/...rum.cgi?post=212197;
Ivan
-----
Iyengar Yoga Resources / GT Plugins
Sep 8, 2002, 12:21 PM
Veteran (19537 posts)
Sep 8, 2002, 12:21 PM
Post #3 of 8
Views: 3469
I use this for 2 cols....
<tr>
<%loop category_loop%>
<%if loop_iteration % '2' and loop_iteration > '1'%>
</tr><tr>
<%endif%>
<td>
<%cat_name%>
</td>
<%endloop%>
</tr>
</table>
Thats from one of my own scripts so you'd need to change the tag names but apart from that it should work.
Code:
<table width="90%" cellpadding="10"> <tr>
<%loop category_loop%>
<%if loop_iteration % '2' and loop_iteration > '1'%>
</tr><tr>
<%endif%>
<td>
<%cat_name%>
</td>
<%endloop%>
</tr>
</table>
Thats from one of my own scripts so you'd need to change the tag names but apart from that it should work.
Sep 25, 2002, 3:40 PM
Enthusiast (577 posts)
Sep 25, 2002, 3:40 PM
Post #4 of 8
Views: 3417
Paul, have you ever had any problems with not closing the <td> spare <td> tag ... i am just worried about ending up with
<table>
<tr>
<td>something</td>
<td>something else</td>
<td>one more</td>
</tr><tr>
<td>something else</td>
</tr></table>
not the best html out there ... and it likely to cause problems if you start bgcoloring the table cells ...
any ideas?
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
<table>
<tr>
<td>something</td>
<td>something else</td>
<td>one more</td>
</tr><tr>
<td>something else</td>
</tr></table>
not the best html out there ... and it likely to cause problems if you start bgcoloring the table cells ...
any ideas?
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
Sep 26, 2002, 6:33 AM
Enthusiast (577 posts)
Sep 26, 2002, 6:33 AM
Post #6 of 8
Views: 3411
Clever, thanks :)
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
Jan 31, 2005, 2:28 AM
Novice (23 posts)
Jan 31, 2005, 2:28 AM
Post #7 of 8
Views: 3213
Hi,
Saw this post and think that you people might have a solution for my requirement...
Its similar just that i want the categories to be listed like this:
A B C D
E F G H
I J K L
I'am using category_loop but it just lists the categories in a single line.....
How do i alter the category_loop code which i have embedded in the template:
<%loop category_loop%>
<tr><td class="specLst"> • <a href="/car-rentals/<%category_file_name($Short_Name)%>.html"><%Short_Name%></a></td></tr>
<%endloop%>
i do not have variables like row_num and cat_nums available as well donno why but they were not listed when i used the tag <%GT::Template::dump%> in the template, just need to write simple logic to manipulate trs and tds.
Can i do that ?
Kamal
Saw this post and think that you people might have a solution for my requirement...
Its similar just that i want the categories to be listed like this:
A B C D
E F G H
I J K L
I'am using category_loop but it just lists the categories in a single line.....
How do i alter the category_loop code which i have embedded in the template:
<%loop category_loop%>
<tr><td class="specLst"> • <a href="/car-rentals/<%category_file_name($Short_Name)%>.html"><%Short_Name%></a></td></tr>
<%endloop%>
i do not have variables like row_num and cat_nums available as well donno why but they were not listed when i used the tag <%GT::Template::dump%> in the template, just need to write simple logic to manipulate trs and tds.
Can i do that ?
Kamal