Re: table with variables

2004-09-13 Thread Alexander Kleshchevnikov
Sorry, I find out bug in previous code. Use this: use CGI qw(:standard); open (FH, "items.txt") or die "Can't open file. Cause: $!"; my @items = sort ; chomp(@items); print header(); $num_cols = 2; $num_items_in_td = 2; for ($i = 0; defined($items[$i]); $i += $num_items_in_td) { push @tds, t

Re: table with variables

2004-09-13 Thread Alexander Kleshchevnikov
Here's my offer (you can change $num_items_in_td and $num_cols): use CGI qw(:standard); open (FH, "items.txt") or die "Can't open file. Cause: $!"; my @items = sort ; chomp(@items); print header(); $num_cols = 4; $num_items_in_td = 5; for ($i = 0; defined($items[$i]); $i += $num_items_in_td) {

Re: table with variables

2004-09-13 Thread Ing. Branislav Gerzo
Bob Showalter [BS], on Friday, September 10, 2004 at 10:33 (-0400) wrote these comments: >> I want print all items into table, table should have 3 columns. >> I don't know how to do it. BS> What you have prints one row with two columns. It looks like perhaps you BS> want two rows with three column

Re: table with variables

2004-09-12 Thread Alexander Kleshchevnikov
Here's my offer (you can change $num_items_in_td and $num_cols): use CGI qw(:standard); open (FH, "items.txt") or die "Can't open file. Cause: $!"; my @items = sort ; chomp(@items); print header(); $num_cols = 2; $num_items_in_td = 2; for ($i = 0; defined($items[$i]); $i += $num_items_in_td) {

RE: table with variables

2004-09-10 Thread Bob Showalter
Ing. Branislav Gerzo wrote: > > > print table( > > {-border=>>undef}, > > > caption('Choose your favourite brand:'), > > > Tr({-align=>CENTER,-valign=>TOP},), > > > td($items[0], $items[1], $items[2]), > > > td($items[3], $items[4], $items[5]) > > > )

RE: table with variables

2004-09-10 Thread Bob Showalter
Sean Davis wrote: > Just print '' and '' separately. Note that CGI has start_table and end_table methods. If you use function style, you need to import them: use CGI qw(:standard start_table); print start_table; ... print end_table; Actually, you can do this with any tag, not just

Re: table with variables

2004-09-10 Thread Sean Davis
Just print '' and '' separately. Then, you are free to when necessary. Alternatively, if you are doing a good deal of this, look at HTML::Template on cpan--quite nice for doing this type of thing. Sean On Sep 9, 2004, at 6:20 PM, Ing. Branislav Gerzo wrote: Hi CGIers! I have small question ab

Re: table with variables

2004-09-09 Thread Bee
> > CKC> I don't understand the question. What while loop? > CKC> What would it be looping over? > > I want print all items into table, table should have 3 columns. > I don't know how to do it. > > Thanks and sorry for not clear question before. > > -- Do you mean you want a loop for rolling

RE: table with variables

2004-09-09 Thread Charles K. Clarkson
Charles K. Clarkson wrote: : Closer inspection shows the above code doesn't work (right). : I think you wanted this. : : use CGI qw( table Tr td caption ); : : my @items = ( 1 .. 6 ); : print : table( : caption( 'Choose your favourite brand:' ), :

RE: table with variables

2004-09-09 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : Charles K. Clarkson [CKC], on Thursday, September 9, 2004 at : 17:37 (-0500) thinks about: : : : : print table( : : {-border=>>undef}, : : : caption('Choose your favourite brand:'), : : : Tr({-align=>CENTER,-valign=>TOP},), :

Re: table with variables

2004-09-09 Thread Ing. Branislav Gerzo
Charles K. Clarkson [CKC], on Thursday, September 9, 2004 at 17:37 (-0500) thinks about: CKC> : print table( : {-border=>>undef}, CKC> : caption('Choose your favourite brand:'), CKC> : Tr({-align=>CENTER,-valign=>TOP},), CKC> That doesn't look right. Are CENTER and TOP

RE: table with variables

2004-09-09 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : Hi CGIers! : : I have small question about putting variables into CGI : script, which produces table, here is snip of code: : : use CGI qw(:standard); : #... : open FH, items.txt or die "Can't open $!"; : my @items = sort ; : print table( :

Re: table with variables

2004-09-09 Thread Gunnar Hjalmarsson
Ing. Branislav Gerzo wrote: I have small question about putting variables into CGI script, which produces table, here is snip of code: use CGI qw(:standard); #... open FH, items.txt or die "Can't open $!"; my @items = sort ; print table( {-border=>undef}, caption('Choose your favour