in reply to Re: Where can I find a complete reference for CGI.pm? in thread Where can I find a complete reference for CGI.pm?
Well there's an example of a Table object in the POD in CGI.pm, and it uses caption, td, Tr, etc. Are those all the other objects that can be used in a Table object? If not, what are the others? What "arguments" can td, Tr, etc, all take?
Nowhere in the source for CGI.pm are references made to these "subobjects" to where I can see how they function, or what their scope is, etc.
Unless I'm just missing it. I'm using 5.005, btw. Maybe 5.6 does a better job, I don't know. Updating to 5.6 is on my (long) list of things to do...
RE: RE: Re: Where can I find a complete reference for CGI.pm?
by KM (Priest) on May 24, 2000 at 00:08 UTC
|
When you are making a table, what do you use except for TD and TR? These methods (they are not objects) can take whatever params you want to give them, like:
print td({-align=>'CENTER', -colspan=>2}, $data);
Read the POD again, and experiment. You can nest the methods to create the HTML you want. If you want to see how they function, read the source code. I don't know what you are referring to for 'scope', since they are methods you import (or access via a CGI object).
Cheers,
KM | [reply] |
RE: RE: Re: Where can I find a complete reference for CGI.pm?
by takshaka (Friar) on May 24, 2000 at 00:14 UTC
|
Any named parameter not explicitly supported by
CGI.pm's methods will be passed along as-is
into the tag:
chh@scallop chh> perl '-MCGI qw(:standard)' -le 'print td({-BOB => "fo
+o", -CAT => "bar"}, "lala")'
<TD BOB="foo" CAT="bar">lala</TD>
chh@scallop chh>
And you can always write the HTML yourself. I don't
particularly like CGI.pm's HTML-generating methods. | [reply] [d/l] |
RE: RE: Re: Where can I find a complete reference for CGI.pm?
by flyfishin (Monk) on May 24, 2000 at 00:28 UTC
|
This is a bit of a repeat of KM's post but Tr and td are simply
the table row and table data tags of HTML. Whatever
options you can put in a table row tag or a table data
tag you can put in Tr and/or td. As KM mentioned it will
take whatever arguments you pass it. The beauty is that if
a new attribute is added to one of those tags you simply add
that attribute in the arguments list of Tr or td. | [reply] |
|