1
phillipd
Dual or tri column output
  • 2004/11/3 23:23

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I've got a bunch of checkboxes I would like to layout in a two or three column form. I am trying a:

<{foreach item=element from=$layerform.elements}>
<tr>
<td class="<{cycle values="even,odd"}>"><{$element.body}></td>
</tr>

<{/foreach}>

type of affair, but would like to layout in more than a single column. How is this done??? How can I do something like:

<{foreach item=element from=$layerform.elements}>
<tr>
<td class="<{cycle values="even,odd"}>"><{$element.body}></td>
<{next}>
<td class="<{cycle values="even,odd"}>"><{$element.body}></td>
</tr>
<{/foreach}>

So I can get "every other" element to layout in a second or third column? (I know there is no "next" )

Thanks

Doug P

2
Mithrandir
Re:Dual or tri column output

le="color: #000000"><?php <{counter assign=elementno start=0 print=false}> <{foreach item=element from=$layerform.elements}> <{counter}> <tr> <{if $elementno is div by 3}> </td><td> <{/if}> <td class="<{cycle values="even,odd"}>"><{$element.body}></td> </tr>

Try that out

3
phillipd
Re:Dual or tri column output
  • 2004/11/4 2:18

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Thanks for the tip! I have a rudimentary understanding of Smarty and templates but I need more experience...

Doug P

4
phillipd
Re:Dual or tri column output
  • 2004/11/4 6:30

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


That actually doesn't work. It puts the gadgets like this:


gadget1
-------gadget2
gadget3
-------gadget4
gadget5
-------gadget6

I'm fooling around with it to see if I can work it out...

Thanks

Doug P

5
Mithrandir
Re:Dual or tri column output

le="color: #000000"><?php <tr> <{counter assign=elementno start=0 print=false}> <{foreach item=element from=$layerform.elements}> <{counter}> <{if $elementno is div by 3}> </tr><tr> <{/if}> <td class="<{cycle values="even,odd"}>"><{$element.body}></td> <{/foreach}> </tr>


Try this instead.

6
phillipd
Re:Dual or tri column output
  • 2004/11/4 15:59

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Works Perfectly! And it was much simpler than the tutorial. Thank you very much!

Doug P

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits