Frames Tables Forms
Frames Tables Forms
Cells can contain text, images, links, other Tables can also be used for organising the
layout of the web page itself.
B c C!"#$$ %nternet Computing
Tables
<table> main element <tr> <th> <td>
table row table header table data
<table border="1"> <tr> <th>Name</th> <th>Course</th> <th>Year</th> </tr> <tr> <td>A B Morgan</td> <td>Fishing</td> <td>5</td> </tr> <tr> <td>D P Jones</td> <td>Sailing</td> <td>8</td> </tr> <tr> </table>
2
Tables
<table> main element <tr> <th> <td>
table row table header table data
<table border="1"> <tr> <th>Name</th> <td>A B Morgan</td> <td>D P Jones</td> </tr> <tr> <th>Course</th> <td>Fishing</td> <td>Sailing</td> </tr> <tr> <th>Year</th> <td>8</td> <td>5</td> </tr> <tr> </table>
3
<table border="1"> <tr> <th colspan="2">Name</th> <th>Course</th> <th>Year</th> </tr> <tr> <td>A B</td> <td>Morgan</td> <td rowspan="2">Fishing</td> <td>5</td> </tr> <tr> <td>D J</td> <td>Jones</td> <td>Sailing</td> <td>8</td> </tr> <tr> </table> 4
The width
attribute determines the width of the row relative to the table
B c C!"#$$ %nternet Computing
Table attributes Table attributes align alignment relative to the page width in pixels or percentage of page width border ' width of border (pixels) cellspacing separation between cells (pixels) cellpadding ' space around data inside cell (pixels) bgcolor ' background colour (inside cells)
Furthermore The <caption> element puts a title above the table
B c C!"#$$ %nternet Computing
<table border="," align="center" cellspacing="6" cellpadding="6" bgcolor="c-an"> <caption> <h2>Course .ata</h2> </caption> <tr> <th>Name</th> <th>Course</th> <th>Year</th> </tr> <tr> <td>A B Morgan</td> <td>Fishing</td> <td>5</td> </tr> <)* etc ++>
B c C!"#$$ %nternet Computing
Table attributes
*age formatting
Tables can be used to organise the layout o the !eb page itsel
</bod-> <table border="0" cellspacing="10"> <tr> <td> <img src="cat#gi/" alt="cat"> <ul> <li>cats</li> <li>dogs</li> <li>butter lies</li> </ul> </td> <td! "his #iece o te$t illustrates the idea o #lacing t%o columns o in ormation in a %eb #age&&& Note also that there is no border in this table& </td> </tr> </table> </bod-> 8
,xample application: To maintain a permanently visible otherwise the directory of links must appear on
every page, and this scrolls up with the page
directory of links within your site, while also displaying one or more selected documents from the site.
"
+ramesets
<html> <head><title>'rames 1</title></head> </rameset cols="10012"> </rame name="na3'" src="na3igation#html"> </rame name="main'" src="intro#html"> <//rameset> </html>
1#
+rame attributes
</rameset cols="10012"> </rame name="na3'" src="na3igation#html"> </rame name="main'" src="intro#html"> <//rameset>
navigation.html
The anchor tag has a target attribute
takes the name of the frame used to display the information
12
intro.html
A simple document which is initially placed in the "main'"
frame
<html> <head><title>'rames 2</title></head> </rameset cols="10012"> </rame name="na3'" src="na3igation#html"> </rameset rows=",0%1;0%"> </rame name="upper'" src="intro#html"> </rame name="lower'" src="course#html"> <//rameset> <//rameset> </html>
-ested framesets
14
$ome bro!sers cannot process rames% <ernative content should be provided using the no/rames element
<html> <head><title>'rames 1</title></head> </rameset cols="10012"> </rame name="na3'" src="na3igation#html"> </rame name="main'" src="intro#html"> <//rameset> <no/rames> <bod-> <omething here /or browsers not supporting /rames </bod-> </no/rames> </html>
B c C!"#$$ %nternet Computing
-oframes
15
+orms
+orms are user interfaces for data input !ain application: to provide user input for programs and databases located on a web server local (client'side) scripts associated with the form erver'based programs may return data to the client as a web
page
Client'side scripts can read input data To validate the data, prior to sending to server To use in local processing which may output web page
content that is displayed on the client
B c C!"#$$ %nternet Computing
16
,xample applications
2uestionnaires to provide feedback on a web site e'commerce, to enter name, address, details of purchase
and credit'card number re1uest brochures from a company make a booking for holiday, cinema etc. buy a book, cd, etc obtain a map giving directions to a shop &un a database 1uery and receive results (an important part of e'commerce)
B c C!"#$$ %nternet Computing
17
te=t chec>bo= radio 'buttons( select 'options( te=tarea password button submit reset hidden /ile image
B c C!"#$$ %nternet Computing
%nput types
18
The method attribute speci ies the !ay that orm data is sent to the server program ' ?@4 appends the data to the )*+ ' 68<4 sends the data separately The action attribute speci ies a server program 'e%g% a perl program %pl e,tension( that processes the orm data -an also send an email. action/0mailto.1%2%-os3er4%%5
<bod-> </orm method="68<4" action="comments#pl"> <h2>4ell us what -ou thin></h2> <)++ etc ++> <//orm> </bod->
B c C!"#$$ %nternet Computing
1"
The t-pe attribute speci ies the type o user input The name attribute gives an identi ier to the input data The siAe attribute speci ies the length o the input ield The 3alue attribute speci ies an initial value or the te,t 'optional(
</orm method="68<4" action="comments#pl"> <h2>4ell us what -ou thin></h2> Name <input name="name" t-pe="te=t" siAe="20"><br> %ddress <input name="address" t-pe="te=t" siAe=",0"> <//orm> B c C!"#$$ %nternet Computing 2#
The 3alue attribute identi ies the individual chec3bo, 6 the chec>ed attribute is set the bo, is initially chec3ed
5ow did -ou hear about this web siteB<br> % /riend <input t-pe="chec>bo=" name="howdid" 3alue="/riend"><br> <earch engine <input t-pe="chec>bo=" name="howdid" 3alue="engine"><br> <)* etc ++>
B c C!"#$$ %nternet Computing
21
22
.o -ou want to recei3e an- /urther in/ormationC<br> <input t-pe="button" name="-es" 3alue=" es "> <input t-pe="button" name="no" 3alue=" No "><br>
B c C!"#$$ %nternet Computing
23
26
27