Generating html tables on the fly

Discussion in 'Perl' started by smrtalec, Jan 26, 2004.

  1. smrtalec

    smrtalec Guest

    I am trying to scavange a example script I found on the web. The aubroutine
    is below. Basically I want to extract data from a sql db then generate a
    table of values on the fly. The script below keeps generating a malformed
    header error

    sub gen_table {
    my $array_ref=query_data('%Ave%');

    my @headings = ('id no.','street no.','street name','city');
    my @rows = th(\@headings);
    foreach my $row_array (@$array_ref) {
    my ($id,$str_no,$str_name,$city) = @$row_array;
    push(@rows,"td([$id,$str_no,$str_name,$city])");
    }
    print table({-border=>undef,-width=>'25%'},
    caption(b('Wow. I can multiply!')),
    Tr(\@rows)
    );

    }
     
    smrtalec, Jan 26, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. genc_ymeri
    Replies:
    3
    Views:
    500
    JDP@Work
    Mar 14, 2006
  2. D. Alvarado
    Replies:
    1
    Views:
    325
    Andrew Thompson
    Oct 12, 2004
  3. smrtalec

    generating tables on the fly ?

    smrtalec, Jan 26, 2004, in forum: Perl Misc
    Replies:
    4
    Views:
    94
    Scott Yanoff
    Jan 26, 2004
  4. ll
    Replies:
    4
    Views:
    124
    Ron Bergin
    Oct 23, 2007
  5. Brian

    Fly outmenu on the fly

    Brian, Apr 8, 2005, in forum: Javascript
    Replies:
    0
    Views:
    114
    Brian
    Apr 8, 2005
Loading...

Share This Page