The page looks fairly simple, but it has some tricks and new skills
hiding in plain sight!
Care to take a guess what they are after looking at the illustration?
The page is about Ricardo's soccer team, Los Lobos. It lists the team members and the results of their games in the previous season. The background is the team logo.
What you will do: | ![]() Add an image, format it, and center it Create a data table and enter the data Center the table ![]() Create styles for the table and table cells ![]() Create links Add a horizontal rule Print from Notepad and from the browser |
Start with: , resource files
Tip: Save often and check the page in your browser.
<!DOCTYPE html>
<html>
<head>
<title>Los Lobos Game Results by Your Name</title>
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
Save as loslobos-Lastname-Firstname.htm , using your own first and last names, to your Class disk
in the folder class/family/ricardo, where you saved
Ricardo's page in Exercise Web2-1.
Find the width and height for these images using File Explorer.
This BODY style creates a background that stays in place while the page scrolls. Sometimes this is called a watermark, especially when the image does not repeat across the page.
Below the paragraph with the Los Lobos image, create a table with 4 columns and 7 rows, including one header row.
Don't forget that the
table needs an opening and closing TABLE tag.
Each row needs an
opening and closing TR tag.
Each cell needs an opening and closing TD
tag except that the first row uses TH instead of TD.
(Hint - do the TABLE tags, the first row TH tags, and the TD tags for row 2. Then copy the row of TD tags and paste to get the proper number of rows.)
The illustration below shows where you are headed. The table won't
look like this in styling at any point. Don't try to enter the text just yet.
In the code for the first cell in the second row, add to the TD tag rowspan="6"
This creates a merged cell out of six cells in the first column.
Remove one cell each from rows 3, 4, 5, 6, 7.
Add to the table tag id="results".
Create a style in the internal style sheet for this ID:
th {font-family:"Cooper Black", Cambria, "Times New Roman",
serif;
background-color:silver;
border:1px solid black;
font-weight:400;
}
tr {height:40px;}
td {text-align:center;
vertical-align:middle;
border:1px solid
black;
}
td.win {background-color:yellow;}
td.notwin {background-color:white;}
Apply the class win to the merged cell of team members names and
to each cell in rows where Los Lobos won the game - games 1, 4, 5.
Remember that class="win" goes in
each TD tag in the row, not the TR tag. That merged cell won't let us
format a whole row.
Apply the
class notwin to cells in rows where Los
Lobos lost or tied - games 2, 3, 6.
Why set row heights?
The merged cell has to be
tall enough to hold all the team names, even if that is taller than the
automatic table height needed for the number of rows. Each browser has its own defaults for tables and these defaults are slightly different. One fix is to set a row height for
every data row or a cell height for every data cell. The 40px chosen for the TR tag will give a bit more vertical space in each cell in all three of our browsers.
Save.
[loslobos-Lastname-Firstname.htm]
Switch to your
browser and view the page.
The browser has a default style for the
ADDRESS element already - italics, reduced font size, default
paragraph font.
Switch back to your text editor.
Make the text "Ricardo's page" a link back to ricardo-Lastname-Firstname.htm, using your own first and last names, of course. The Los Lobos page is actually within Hector's site in the same folder as ricardo-Lastname-Firstname.htm.
Test the links.
Notice the background of the site Liga Fútbol. It is green with the contents of the page centered in the middle of the window. The DIV for the page contents is 1095 pixels wide. [June, 2016] The window was at full screen, 1680 x 1050.
Insert a horizontal line above the line "Back to Ricardo's page".
Open loslobos-Lastname-Firstname.htm in your browser and scroll. Look for errors. If you find any, return to
Notepad, fix the errors, and save again.
Header =Your Name &f Exercise Web 2-2
Footer = Page &p &d
Print from Notepad - 2 or 3 pages, depending on your spacing
and margins.
You need some resource files to create the web pages in the exercises. If you have not already installed these on your Class disk, do so now.
Individual files can be downloaded as you need them from http://www.jegsworks.com/Lessons/resources/web resources/HTML/Exercises/ They should be saved to your Class disk in the folder
[drive for Class disk]:\my docs\web project2\Exercises