Re: [htmltmpl] Coding up a three column table...

2004-05-14 Thread Dave Hodgkinson
> (warning, totally untested, but it probably works) Thanks Roger, that's an HTML idiom I'll use again :-) --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 conn

Re: [htmltmpl] Coding up a three column table...

2004-05-12 Thread Mathew Robertson
if you are using H::T::E you can leave your output formatting to the template, and leave your Perl code as a single loop (with no embedded loops). eg: my @loop; for ... { push @loop, something; } $t->param(loop => [EMAIL PROTECTED]);

Re: [htmltmpl] Coding up a three column table...

2004-05-12 Thread Benjamin Warfield
On Wed, 12 May 2004, Carl Franks wrote: > my $cols = 3; > > my @foo = ({one => 1, ein => 1},{two => 2, zwei => 2}, >{three => 3, drei => 3}, {four => 4, vier => 4}); > my @bar; >From here, wouldn't it be simpler to use splice? push @bar, [splice @foo,0,$cols] while @foo; It

Re: [htmltmpl] Coding up a three column table...

2004-05-12 Thread Carl Franks
One way to do it might be: use strict; use Data::Dumper; my $cols = 3; my @foo = ({one => 1, ein => 1},{two => 2, zwei => 2}, {three => 3, drei => 3}, {four => 4, vier => 4}); my @bar; for (my $n=0; $n<=$#foo; $n+=$cols) { my @row; for (1..$cols) { push @row, $foo[$n+($_

Re: [htmltmpl] Coding up a three column table...

2004-05-12 Thread Roger Burton West
On Wed, May 12, 2004 at 10:05:03AM +0100, Dave Hodgkinson wrote: >I've got an image gallery that I want displayed as three columns. >Am I right in assuming that I need to code it up as an array of rows >containing the array of the column cells? No, but that's one way to do it. Another, and what I'

[htmltmpl] Coding up a three column table...

2004-05-12 Thread Dave Hodgkinson
I've got an image gallery that I want displayed as three columns. Am I right in assuming that I need to code it up as an array of rows containing the array of the column cells? Anyone got any nice idiomatic perl for transforming a simple array into one of these? ;-) Ta, Dave