Layout ] Multimedia ] Programming ] Scripting ] Communicate ] Navigation ]

Forms and Tables

Up ] HTML Document Structure ] Standard Tags ] [ Forms and Tables ]

Here is the format for a Table:

<TABLE BORDER="1"> <!-- Start a table -->
<TR> <!-- Start a row -->
<TD> This is the first cell in a row.  The next cell will be to the right of this one.</TD> <!-- First cell in the row -->
<TD>This is the second cell in a row.</TD>
</TR> <!-- End the row -->
</TABLE> <!-- End the table -->

This is the first cell in a row. The next cell will be to the right of this one. This is the second cell in a row.

Tables are the most time consuming part of HTML.  For this, a WYSIWYG table editor is VERY helpful.


Forms allow users to input information, and for the server to respond in some way through CGI.  Forms are contained in a <FORM> tag.  There are two important attributes for the FORM tag:
ACTION: the path to the CGI program that handles the form
METHOD: either GET or POST.  Which to use depends on which the CGI program supports.

Inside the form, you can put form elements as well as other HTML.  There are four special tags to use for form elements:

Tag Attributes Values Value Meaning
<INPUT>, no end tag Allows various types of user input
  NAME: Tells the CGI what sort of data it is    
  VALUE: The data to be sent Depends on the form  
  TYPE: What type of input control to create Checkbox Is either checked or unchecked.  Sends the Name/Value pair only if it is checked.   Can be set to checked by default by adding in the CHECKED attribute with no value.
    Hidden Used for information that the CGI needs, but shouldn't be changed by users.  No visible display.
    Image An image, specified by the SRC attribute.  Is similar to the Submit value, but displays an image instead of a button and sends the coordinates where the image was clicked in name.x and name.y.
    Password A text field in which the input is shown as asterisks.  SIZE will specify how many characters wide the textbox is.
    Radio When multiple radio buttons are placed on a page with the same NAME attribute, only one can be selected, and that one's VALUE is sent.  Can be specified as selected by default with the CHECKED attribute with no value.
    Reset A button to reset the form to its default values.
    Submit A button which has the VALUE as the text label, and submits the data in the form to the CGI.
    Text A simple one-line textbox.  SIZE will specify how many characters wide the textbox is.
<SELECT> ... </SELECT> Contains OPTIONs
  NAME: Tells the CGI what sort of data it is Depends on the CGI  
  MULTIPLE: Makes it so that more than one value can be selected from the list No value  
  SIZE: How many options to display at a time, only if MULTIPLE is used A number greater than 1  
<OPTION> ... </OPTION> Only used inside a SELECT tag.  The included text should be a description of the value.
  VALUE: The data to be sent Depends on the form  
  SELECTED: makes an option selected by default No value  
<TEXTAREA> ... </TEXTAREA> Multi-line text box.  Contains the default text.
  NAME: Tells the CGI what sort of data it is Depends on the CGI  
  COLS: How wide the textarea should be Number  
  ROWS: How tall the textarea should be Number  
Back ] Up ]
Layout ] Multimedia ] Programming ] Scripting ] Communicate ] Navigation ]
HTML Document Structure ] Standard Tags ] [ Forms and Tables ]

The Web Wizard's Spellbook © 1998, Team WWS