jck has asked for the wisdom of the Perl Monks concerning the following question:

with the CGI module, is it possible to set the column widths in a table??

i tried:

print table( col({-width=>250px}), col({-width=>150px}), Tr([ td(['first column','second column']) ]) );
which gave me the error: "syntax error at tableedit.pl line 147, near "250px""

obviously, i can pull out the table starting tag, and just print the column width specifications in regular html, but if there's a way to do it with CGI, i'd love to use it.

Replies are listed 'Best First'.
Re: CGI table column widths
by jck (Scribe) on Dec 25, 2009 at 03:27 UTC
    oops - just after posting this, i came up with the answer!! i needed to put quotes around the 250px

    this works:

    print table( col({-width=>'250px'}), col({-width=>'150px'}), Tr([ td(['first column','second column']) ]) );