I HIGHLY recommend Lincoln Stein's CGI.pm book as he wrote the module. The 
book is short, very easy to read and has great code. The answer to your 
question is on pages 281-283.

print
   table({-border=>''},
   caption(strong('When Should you Eat your Vegetables?')),
       tr( { -align=>CENTER, -valign=>TOP},
         [ th(['', 'Breakfast', 'Lunch','Dinner'])),
           th('Tomatoes'), td(['no','yes','yes'])),
           th('Brocolli'), td(['no','no','yes'])),
           th('Onions'), td(['yes','yes','yes']))
          ]
       };

The text field function is on page 252-263. So, you'd do:

print textfield( -name=>'favorite_color', -value=>'purple', -size=>50, 
-maxlength=>80);

In the above table it has one header row and four columns. You could put 
whatever you want in the rows of course, here show the vegetable words and 
yes/no. You can just as easily add the textfield() function.

There are a large number of variables you can use with tables (since tables 
can be set in many different configurations).

Deborah

At 02:25 PM 10/6/2001, [EMAIL PROTECTED] wrote:
>Message-ID: <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>From: "fx" <[EMAIL PROTECTED]>
>Subject: textfield in table
>Date: Sat, 6 Oct 2001 23:27:10 +0800
>MIME-Version: 1.0
>
>hi,
>
>i am a beginner to perl and cgi. i need to use cgi.pm to write a table in
>which there is a textfield for user input.
>
>could someone advise me how to do it ? i am using the object oriented
>approach.
>
>thanks in advance.

Reply via email to