1
gruessle
Math
  • 2004/4/16 7:10

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20


Following code is from MyAds file myads_category.html.

I can't get it to show colums and rows right.
I think it has something to do with <{math equation="i % 3" and style="width:33%. I have tried all possible combinations I could think of.

I don't care anymore if i have 2 or 3 columns if I just get it right.

The way it is right now it shows
2 colmns then one single
2 colmns then one single
2 colmns then one single
etc.

You can see it here:
http://www.vmclinks.com/x/modules/myAds/index.php?pa=view&cid=2


<table border="0" style="width:100%;">
        <{foreach 
item=cat from=$subcategories}>
        <{
math equation="i % 3" i=$cat.i assign="mod"}>
            <{if 
$mod == 0}><tr><{/if}>
            <
td valign="top" align="center" style="width:33%;">
            <
table class="outer" cellspacing="0" style="width:100%;">
              <
tr><td class="head"><{$cat.image}> <{$cat.link}> (<{$cat.adcount}>) <{$cat.new}>td>tr>
            table>
            td>
            <{if 
$mod == || $cat.== $subcat_count}>tr><{/if}>
        <{/foreach}>
      table>

2
rabideau
Re: Math
  • 2004/4/16 12:48

  • rabideau

  • Home away from home

  • Posts: 1042

  • Since: 2003/4/25


You have a line wrap problem. I see 3 cols. 1 col (repeat).

Try using a fixed pixel width for your table rather than %s. This should give you better control of how things appear.

Hope this helps.

3
builderb
Re: Math
  • 2004/4/16 17:27

  • builderb

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/8/4 2


Try changing this line:
<{if $mod == 2 || $cat.i == $subcat_count}><{/if}>

to this:
<{if $mod == 3 || $cat.i == $subcat_count}><{/if}>

I believe the problem with the layout is the way it handles "extra" columns. What I mean is...If you make this change it will work for all categories that are divisible by 3 but if you have an odd-ball number like "7" categories then you will run into the same problem again. and since we're dealing with a template that is used for all categories and sub-categories it needs to be able to handle the extra 's where they don't quite fill up the row.

I have the same problem but I haven't had the time to dig in and really correct the problem.

Let me know if you or someone else is able to fix it.


Builderb

Login

Who's Online

183 user(s) are online (81 user(s) are browsing Support Forums)


Members: 0


Guests: 183


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits