Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    HTML::QuickTable 1.12

    Download button

    No screenshots available
    Downloads: 320  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Nathan Wiger | More programs
    Perl Artistic License / FREE
    September 29th, 2006, 12:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    HTML::QuickTable description

    A Perl module to quickly create fairly complex HTML tables

    HTML::QuickTable is a Perl module to quickly create fairly complex HTML tables.

    SYNOPSIS

    use HTML::QuickTable;

    my $qt = HTML::QuickTable->new(
    table_width => '95%', # opt method 1
    td => {bgcolor => 'gray'}, # opt method 2
    font_face => 'arial', # set font
    font => {face => 'arial'}, # same thing
    labels => 1, # make top ?
    stylesheet => 1, # use stylesheet?
    styleclass => 'mytable', # class to use
    useid => 'results', # id="results_r1c2" etc
    header => 0, # print header?
    );

    my $table1 = $qt->render(@array_of_data);

    my $table2 = $qt->render(%hash_of_keys_and_values);

    my $table3 = $qt->render($object_with_param_method);


    This modules lets you easily create HTML tables. Like CGI::FormBuilder, this module does a lot of thinking for you. For a comprehensive module that gives you the ability to tweak every aspect of table building, see HTML::Table or Data::Table. This one gives you a lot of control, but is really designed as an easy way to expand arbitrary data structures.

    The simplest table can be created with nothing more than:

    my $qt = HTML::QuickTable->new;
    print $qt->render(@data);

    Where @data would be an array holding your data structure. For example, the data structure:

    @data = (
    [ 'nwiger', 'Nathan Wiger', 'x43264', 'nate@wiger.org' ],
    [ 'jbobson', 'Jim Bobson', 'x92811', 'jim@bobson.com' ]
    );


    Would be rendered as something like:

    < table >
    < tr >< td >nwiger< /td >< td >Nathan Wiger< /td>< td >x43264< /td >< td >nate@wiger.org< /td >< /tr >
    < tr >< td >jbobson< /td >< td >Jim Bobson< /td>< td >x92811< /td>< td >jim@bobson.com< /td >< /tr >
    < /table >


    Of course, the best use for this module is on dynamic data, say something like this:

    use DBI;
    use HTML::QuickTable;

    my $qt = HTML::QuickTable->new(header => 1); # print header
    my $dbh = DBI->connect( ... );

    my $all_arrayref = $dbh->selectall_arrayref("select * from billing");

    print $qt->render($all_arrayref);

    With header => 1, you will get a brief CGI header as well as some basic HTML to prettify things. As such, the above will print out all the rows that your query selected in an HTML table.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    HTML tables | create tables | Perl module | module | create | HTML

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM