Re: [SMARTY] A better way to create a table based on the number of elements

From: Date: Wed, 26 Feb 2003 05:52:08 +0000
Subject: Re: [SMARTY] A better way to create a table based on the number of elements
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8190@lists.php.net to get a copy of this message
Thanks!!!!! :-) Jason Sweat wrote: > http://smarty.php.net/contribs/examples/dynamic_table_columns/table.tpl.txt > > ----- Original Message ----- > From: "jun" <juney20@yahoo.com> > To: <smarty-general@lists.php.net> > Sent: Tuesday, February 25, 2003 5:56 PM > Subject: [SMARTY] A better way to create a table based on the number of > elements > > >> >> Hi! I'm creating a simple online photo-album using PHP and Smarty. Yes, >> after some convincing to myself that Smarty is easy.. .I have done it. > But, >> I have questions regarding generating tables with variable Table Data >> <TD> What I wanted to do is to create a table Like ( i hope my message >> will > show >> up in correct format). >> >> >> My Family Picture >> ____________________ >> | | | >> | | | >> | img 1 | img 2 | >> | | | >> |---------+----------| >> | | | >> | img 3 | img 4 | >> +---------+----------+ >> | | | >> | img 5 | | >> +---------+----------+ >> >> >> >> The above figure is what I want my script to generate thru Smarty. >> What I do is I pass an associative array called $Pictrures >> >> $Pictrures[0][pic_id] = 1; >> $Pictrures[0][pic_title] = "Title 1"; >> $Pictrures[0][pic_desc] = "Description of Pic 1"; >> >> $Pictrures[0][pic_id] = 2; >> $Pictrures[0][pic_title] = "Title 2"; >> $Pictrures[0][pic_desc] = "Description of Pic 2"; >> >> $Pictrures[0][pic_id] = 3; >> $Pictrures[0][pic_title] = "Title 3"; >> $Pictrures[0][pic_desc] = "Description of Pic 3"; >> >> $Pictrures[0][pic_id] = 4; >> $Pictrures[0][pic_title] = "Title 4"; >> $Pictrures[0][pic_desc] = "Description of Pic 4"; >> >> $Pictrures[0][pic_id] = 5; >> $Pictrures[0][pic_title] = "Title 5"; >> $Pictrures[0][pic_desc] = "Description of Pic 5"; >> >> >> >> How can I use Smarty to produce an output where all images are listed >> from LEFT TO RIGHT, TOP TO BOTTOM as shown in the above figure. What >> happens if the number of elements of $Pictures is an ODD number.. that >> means, I have one empty TABLE DATA <TD> on the right part of the table. >> >> I hope that my question will have an answer soon.. More power to alll >> >> Smarty is great! Show me more :-) >> >> jun >> >> >> >> >> -- >> ------------------------------------- >> its never enough >> >> >> -- >> Smarty General Mailing List (http://smarty.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> -- ------------------------------------- its never enough

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