Re: [SMARTY] printing 2 values per (table) row from db

From: Date: Sun, 19 May 2002 17:40:51 +0000
Subject: Re: [SMARTY] printing 2 values per (table) row from db
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4307@lists.php.net to get a copy of this message
This might help: http://www.phpinsider.com/php/code/Smarty/contribs/examples/dynamic_table_columns/table.tpl.txt Or this: http://www.mapledesign.co.uk/coding/smarty_table.php Monte jkpsj wrote:
smarty 2.1.1 ------------ dear all i have a caetgory table with 5 category names: Accommodation, Business, Computers, Careers and Education. my php script reads in this table and i want to print them like: Accommodation Business
Computers      Careers
Education my template file: <table> {section name=content loop=$category} {assign var="catname" value=$category[content].cname} {cycle id=0 values="$catname" print=false} {cycle id=1 values="$catname" print=false} {if $tpl.section.content.index is even}
      {assign var="cycle_id" value=0}
{else}
      {assign var="cycle_id" value=1}
{/if} <tr>
      <td>{cycle id=$cycle_id}</td>
      <td>{cycle id=$cycle_id}</td>
</tr> {/section} </table> sadly, the output looks like: Accommodation Accommodation
Business       Business
Computers      Computers
Careers        Careers
Education      Education
how do i correct this. greatly appreciate your advice. rgds -- jkpsj __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com


« previous php.smarty.general (#4307) next »