IT145 - Introduction to HTML

NOTE: Quiz on Projects 1-3 on Thursday!

Project 4 - Creating Tables in a Web Site

Tuesday, September 19, 2006

Assignment 5

Today we will begin Project 4 from the text book (see slides at: Project-04.pdf). The text book web site may be found at: http://www.scsite.com/html3e/

Tables are an important addition to your web skills. They have been used in the past to control page layout. Current web standards encourage the use of CSS to control page layout but you will still see tables used to control web page layout, especially in legacy web pages. Tables are intended to provide the web page designer tools to place page elements in rows and columns.

Creating Tables in a Web Site

Project Objectives

  1. Define table elements
  2. Describe Project 4 the steps used to plan, design, and code a table
  3. Create a borderless table to organize images
  4. Create a vertical menu bar with text links
  5. Create a borderless table to organize text
  6. Create a horizontal menu bar with text links
  7. Create a table with borders
  8. Change the horizontal alignment of text
  9. Add background color to rows and cells
  10. Alter the spacing between and within cells using the cellspacing and cellpadding attributes
  11. Insert a caption below a table
  12. Use the rowspan and colspan attributes

Starting Notepad

  1. Click the Start button on the taskbar
  2. Point to All Programs on the Start menu, point to Accessories on the All Programs submenu, and then click Notepad on the Accessories submenu
  3. If the Notepad window is not maximized, click the Maximize button on the Notepad title bar to maximize it
  4. Click Format on the menu bar and, if necessary, click Word Wrap to turn Word Wrap on

Entering the HTML Tags to Define the Web Page Structure

Creating a Borderless Table to Position Images

  1. If necessary, click line 10
  2. Type <table border="0" cols="2" width="90%"> and then press the ENTER key

Inserting Images in a Table

  1. If necessary, click line 11, type <tr> as the tag, and then press the ENTER key
  2. Type <td><img src="bellvideologo.gif" width="430" height="74" alt="Bell Video Logo" /></td> and then press the ENTER key
  3. Type <td><img src="csexcellence.gif" width="108" height="94" alt="Excellence Award" /></td> and then press the ENTER key
  4. Type </tr> and then press the ENTER key
  5. Type </table> and then press the ENTER key

Creating a Vertical Menu Bar with Text Links

  1. If necessary, click line 17
  2. Enter the HTML code shown below
  3. Press the ENTER key twice

Adding Text to a Table Cell

  1. If necessary, click line 27
  2. Enter the HTML code as shown in Table 4-5 on page HTM 151 and then press the ENTER key

Saving and Printing the HTML File

  1. With a floppy disk in drive A, click File on the menu bar and then click Save As. Type bellvideohome.html in the File name text box
  2. If necessary, click 3½ Floppy (A:) in the Save in list. Click the Project04 folder and then click the Project Files folder in the list of available folders. Click the Save button in the Save As dialog box
  3. Click File on the menu bar and then click Print on the File menu

Viewing and Printing a Web Page

Copying and Pasting HTML Code to a New File

  1. Click the Notepad button on the taskbar
  2. Click immediately to the left of the < in the <!DOCTYPE html tag on line 1. Drag through the first </table> tag on line 15 to highlight lines 1 through 15
  3. Press CTRL+C to copy the selected lines to the Clipboard
  4. Click File on the menu bar and then click New
  5. Press CTRL+V to paste the contents from the Clipboard into a new file

Changing the Title

  1. Highlight the words, - Great Service, Great Selection, between the <title> and </ title > tags on line 7. Type - New Releases as the text
  2. Click immediately to the right of the </table> tag on line 15. Press the ENTER key three times
  3. Type </body> and then press the ENTER key
  4. Type </html> as the end tag

Deleting an Image

  1. Highlight line 13, which contains the code to insert the image, csexcellence.gif
  2. Press the DELETE key twice

Creating a Horizontal Menu Bar with Text Links

  1. If necessary, click line 16
  2. Enter the HTML code as shown in Table 4-6 on page HTM 159
  3. Press the ENTER key twice

Creating a Table with Borders and Inserting Text

  1. If necessary, click line 28
  2. Enter the HTML code as shown in Table 4-7 on page HTM 162
  3. Press the ENTER key twice

Creating Additional Cells and Inserting Text

  1. If necessary, click line 53
  2. Enter the HTML code as shown in Table 4-8 on page HTM 164

Saving and Printing an HTML File

  1. With a floppy disk in drive A, click File on the menu bar and then click Save As. Type newreleases.html in the File name text box
  2. If necessary, click 3½ Floppy (A:) in the Save in list. Click the Project04 folder and then click the ProjectFiles folder in the list of available folders. Click the Save button in the Save As dialog box
  3. Click File on the menu bar and then click Print on the file menu

Viewing and Printing the Web Page Using the Browser

  1. Opening an HTML File
  2. Click the Notepad button on the taskbar
  3. With the HTML Data Disk in drive A, click File on the menu bar and then click Open on the File menu
  4. If necessary, click the Look in box arrow and then click 3½ Floppy (A:). Click the Project04 folder and then click the Project Files folder in the list of available folders
  5. If necessary, click the Files of type box arrow and then click All Files
  6. Click actor.html in the list of files and then click the Open button in the Open dialog box

Opening an HTML File

Adding Cellspacing and Cellpadding to a Table

  1. Click immediately to the right of the 5 in border="5" in line 28 and then press the SPACEBAR
  2. Type cellpadding="2" cellpadding="5" as the attributes

Adding a Table Caption

  1. Highlight the text <!--Insert caption here --> on line 69
  2. Type <caption align="bottom"><em>Listing of movies by actor</em></caption> as the tag

Saving and Printing the HTML File and Viewing and Printing the Web Page

  1. With the floppy disk in drive A, click File on the menu bar and then click Save
  2. Click File on the menu bar and then click Print
  3. Click the Internet Explorer button on the taskbar
  4. Click the Refresh button on the Standard Buttons toolbar
  5. Click the Print button on the Standard Buttons toolbar

Opening an HTML File

  1. Click the Notepad button on the taskbar
  2. With the HTML Data Disk in drive A, click File on the menu bar and then click Open on the File menu
  3. If necessary, click the Look in box arrow and then click 3½ Floppy (A:). Click the Project04 folder and then click the ProjectFiles folder in the list of available folders
  4. If necessary, click the Files of type box arrow, click All Files, and then double-click type.html in the list of files.

Spanning the Main Heading across All Columns

  1. Highlight the <!-Insert Movies by Type colspan here --> text on line 29. Type <tr> and then press the ENTER key
  2. Type <th colspan="3" bgcolor="lightsteelblue"> and then press the ENTER key
  3. Type <font color="#993366" face="chaucer" size="+2">Movies by Type</font> and then press the ENTER key
  4. Type </th> and then press the ENTER key
  5. Type </tr> as the end table row tag

Creating Headings that Span Rows and Columns

  1. Highlight <!--Insert Action rowspan here --> text on line 34
  2. Enter the HTML code as shown in Table 4-9 on page HTM 179

Creating the Second Heading that Spans Rows

  1. Highlight the <!--Insert Comedy rowspan here --> text on line 66 and then press the DELETE key
  2. Type <tr> and then press the ENTER key
  3. Type <th rowspan="4" bgcolor="#336699"> and then press the ENTER key
  4. Type <font color="#ffffff" size="+1">Comedy</font> and then press the ENTER key
  5. Type </th> as the tag

Creating the Second Heading that Spans Columns

  1. Highlight the <!--Insert Title - Actor(s) colspan here --> text on line 70
  2. Type <th colspan="2" bgcolor="thistle"> and then press the ENTER key
  3. Type <font color="#336699" size="+1">Title - Actor(s)</font> and then press the ENTER key
  4. Type </th> and then press the ENTER key
  5. Type </tr> and then press the ENTER key

Saving and Printing the HTML File and Viewing and Printing the Web Page

  1. With the HTML Data Disk in drive A, click File on the menu bar and then click Save
  2. Click File on the menu bar and then click Print
  3. Click the Internet Explorer button on the taskbar
  4. Click the Refresh button on the Standard Buttons toolbar
  5. Click the Print button on the Standard Buttons toolbar

Project Summary

  1. Define table elements
  2. Describe the steps used to plan, design, and code a table
  3. Create a borderless table to organize images
  4. Create a vertical menu bar with text links
  5. Create a borderless table to organize text
  6. Create a horizontal menu bar with text links
  7. Create a table with borders
  8. Change the horizontal alignment of text
  9. Add background color to rows and cells
  10. Alter the spacing between and within cells using the cellspacing and cellpadding attributes
  11. Insert a caption below a table
  12. Use the rowspan and colspan attributes

Project 4 Complete

Next: Project 4 continued ...

Questions or comments should be directed to the instructor, Bob Judd at it145@worldnet.att.net