Re: [SMARTY] alphabetically down columns in a table
| From: | messju mohr | Date: | Mon, 10 Jan 2005 15:10:19 +0000 |
| Subject: | Re: [SMARTY] alphabetically down columns in a table | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12137@lists.php.net to get a copy of this message | ||
On Mon, Jan 10, 2005 at 02:40:28PM +0000, Abdul-Wahid Paterson wrote:
> Hi,
>
> I have some data that I want to display in columns (2 or more) sorted
> alphabetically. However, instead of going across the columns
> alphabetically I want it to go down the columns. Is there any way of
> doing this easily in smarty given an array of data.
>
> E.g...formatted data would be like
>
>
> aa af ak
> ab ag al
> ac ah am
> ad ai an
> ae aj
>
> rather than like
>
>
> aa ab ac
> ad ae af
> ag ah ai
> aj ak l
> am an
if your array is one dimensional and sorted alphabetically, then this:
{html_table inner=rows cols=3 loop=$array}
should give the result you desire. "inner=rows" means: "put
neighbouring values in the array into neighbouring rows in the
table". the default is 'inner="cols"' and gives your second examples
(the not desired one) as output.
HTH
messju
> Thanks,
>
> Abdul-Wahid
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php