in reply to Re: Tabular monstrosities
in thread Tabular monstrosities
verse this areprint header(), table ({-border=> "0", -width=> "340"}, Tr ({-valign=> "top"}, td ( font ({-face=> "verdana,arial"}, " Column One ", ), "\n", ), "\n", td ( font ({-face=> "verdana,arial"}, " Column Two ", ), "\n", ), "\n", ), "\n", Tr ({-valign=> "top"}, td ( font ({-face=> "verdana,arial"}, " Data ", ), "\n", ), "\n", td ( font ({-face=> "verdana,arial"}, " Data ", ), "\n", ), "\n", ), "\n", ), "\n", ;
They are both functionally equivalent for non-form fields, only the first is more shorter and clearer to read. Unless you are subclassing CGI.pm and have special instance specific stuff tied to the HTML generation of non-form fields, why would you use the latter?print $cgi->header(), $cgi->table ({-border=> "0", -width=> "340"}, $cgi->Tr ({-valign=> "top"}, $cgi->td ( $cgi->font ({-face=> "verdana,arial"}, " Column One ", ), "\n", ), "\n", $cgi->td ( $cgi->font ({-face=> "verdana,arial"}, " Column Two ", ), "\n", ), "\n", ), "\n", $cgi->Tr ({-valign=> "top"}, $cgi->td ( $cgi->font ({-face=> "verdana,arial"}, " Data ", ), "\n", ), "\n", $cgi->td ( $cgi->font ({-face=> "verdana,arial"}, " Data ", ), "\n", ), "\n", ), "\n", ), "\n", ;
|
|---|