For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > January 2008 > formatting tables generated by checkbox_group()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author formatting tables generated by checkbox_group()
Neil

2007-11-26, 6:56 pm

Hi,

I was wondering if its possible to get the class="" field passed to
the tables generated by checkbox_group()?

For example, I have the following code

$q -> checkbox_group(-name=>'GroupingOptions', -values=> [ '--
bySex', '--byFamily' ], -labels=> \%GroupingOptions, -columns=>2),

which generates the following table with checkboxes



<table><tr><td><label><input type="checkbox" name="OutputOptions"
value="--pairs" />Summarise pairs of relationships (--pairs)</label></
td><td><label><input type="checkbox" name="OutputOptions" value="--
markerTables" />Report marker statistics (heterozygosity, genotyping
rates, etc.) (--markerTables)</label></td></tr><tr><td><label><input
type="checkbox" name="OutputOptions" value="--rewritePedigree" /
>Rewrite Pedigree File (--rewritePedigree)</label></td></tr></table>


but I've defined two different styles for tables in my css file

TABLE {font-family: Helevitica, Arial, sans-serif; font-size: 12px;
font-weight: n
ormal;}
TABLE.blank {font-family: Helevitica, Arial, sans-serif; font-size:
10px; font-weight: n
ormal;}

and would like the table field to include the class="blank" so that
the font size is set. Works fine in html, but can I pass the
class="blank"?

I tried

$q -> checkbox_group({-class='blank'}, -name=>'GroupingOptions',
-values=> [ '--bySex', '--byFamily' ], -labels=> \%GroupingOptions, -
columns=>2),

but the table and checkboxes weren't drawn. Should I redefine my css
styles so that the blank table is actually how I want default tables
to be (i.e. change the font-size in the two lines given), or is it
possible to get the class="" set vic CGI.pm?

Cheers

Neil

Sean Davis

2007-11-27, 3:55 am

On Nov 26, 2007 5:10 PM, neil <nshephard@gmail.com> wrote:
> Hi,
>
> I was wondering if its possible to get the class="" field passed to
> the tables generated by checkbox_group()?


Not a direct answer to your question, but you will want to move away
from using CGI to generate HTML and move toward using a templating
system such as HTML::Template or Template Toolkit. It is a little
more investment up front, but it is definitely worth the learning if
you are talking about styling pages. Template engines move the VIEW
out of your code. Let the code do the business logic and the template
engine take care of the presentation.

Sean
Peme13

2008-01-10, 1:51 pm

Girl lovers!
http://nicest-lesbyans.info/vids?218571.wmv

http://nicest-lesbyans.info/lesbyan3.jpg
Hardcore girls!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com