Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS205 Tables & Forms © 2012 D. J. Foreman.

Similar presentations


Presentation on theme: "CS205 Tables & Forms © 2012 D. J. Foreman."— Presentation transcript:

1 CS205 Tables & Forms © 2012 D. J. Foreman

2 Tables © 2012 D. J. Foreman

3 Basic <table>Syntax
<table cols=# of columns > <tr> defines one ROW <td></td> defines one CELL <td></td> </tr>    more rows    </table> © 2012 D. J. Foreman

4 Major <TABLE> attributes
border border thickness (e.g. 4) cellpadding margin around text cellspacing between cells cols helps compute table width frame border around whole table rules inside borders width whole table © 2012 D. J. Foreman

5 Syntax for Table Cells <th align=… colspan=… rowspan=… valign=… > Options only affect current cell <td> uses same options as <TH> <caption> applies a title to top of table © 2012 D. J. Foreman

6 Forms © 2012 D. J. Foreman

7 Basic <Form> Syntax -1
<form action=URL method=(post/get)> <input name="field1"> <select> <option value="value1"> </option>    more option tags    </select> </input> </form> Usually uses a TABLE to line up fields © 2012 D. J. Foreman

8 Caution Don't confuse the terminology: OPTION as a tag:
OPTION actually an attribute on a tag <BODY bgcolor='red'> © 2012 D. J. Foreman

9 Basic <Form> Syntax -2
<form action=URL method=(post/get)> URL is to locate the CGI program CGI = Common Gateway Interface <table> <tr> <td><input></input></td> </tr> </table> </form> © 2012 D. J. Foreman

10 <Form> methods Post Get preferred
data accessed via "standard input" (standard input/output is terminal I/O) Get less common (limited length) data passed as a parameter contains callers URL URL could be truncated © 2012 D. J. Foreman

11 <FORM> processing
User clicks a "submit" button Browser send data to server Server starts the CGI program Server gives data to CGI program CGI program "builds" a webpage Output via "standard output" Contains HTML tags AND text Server sends "page" to browser Browser displays page © 2012 D. J. Foreman

12 CGI's CGI programs can be written in: A CGI always runs on the server
Perl, Java, C++, C, etc. A CGI always runs on the server User cannot see the CGI program Sometimes called a "script" MS script files: anypage.ASP CGI Example: Dr. Foreman's CS105 Grade Tracker © 2012 D. J. Foreman


Download ppt "CS205 Tables & Forms © 2012 D. J. Foreman."

Similar presentations


Ads by Google