Hi,

I work on a little HTML-table-generator. There are plenty of them availible, 
but I still decided to try my own. And I would like to here, what you think 
of it.

It is a fully object-oriented implementation. My intention is, that it is 
really easy to use. It makes no sense, if it is easier to write HTML 
yourself. Here is a example-script:

#!/usr/bin/perl -w

use strict;
use HTML::OOTable;

my $t = new HTML::OOTable(['wert1', 'wert2'], ['wert3', 'wert4']);

$t->cell(0, 0)->attr(bgcolor => 'red', font => 'arial,helvetica')
              ->attr(colspan => 2);

$t->append('wert5', 'wert6');
  $t->append(['www1', 'www2'],
             ['www3', 'www4']);
$t->cell(4, 1)->attr(bgcolor => 'red');
$t->cell(4, 0)->th->attr(font => 'courier');
$t->row(2)->th;
$t->row(2)->attr(ttt => 'uhu');
$t->row(1)->cellattr(fgcolor => 'blue');
$t->row(1)->append('uhu');
$t->insert(0, ['head1', 'head2'])->th;

print $t->as_html;
__END__

In fact just the constructor is needed. I try to accept the data in various 
formats, so that you can just the data in the format you happen to have it. 
You can just pass an arrayref of a DBI::selectall_arrayref-method and insert 
a header. This takes just 2 lines of code (not perlish-, but readable-code).

I haven't a package yet and the module has no documentation at all, so I don't 
attach it yet. If you are interested in the module, please let me know.


Tommi

Reply via email to