BackExercise 2.1



Using Center, Table, TR, TH, TD tags and the ColSpan attribute, write the HTML for a table which will be displayed as:

SaturdaySunday
MorningAfternoonMorningAfternoon
9.00Enrol2.00Practical session10.00Review2.00Practical session
10.00Introduction5.00Discussion11.00Further problems4.00End of course

Note:  There are two approaches to this — if you have time you might try both.  The above example uses a single table.  A second way using multiple tables produces output like this:

SaturdaySunday
Morning
9.00Enrol
10.00Introduction
Afternoon
2.00Practical session
5.00Discussion
Morning
10.00Review
11.00Further problems
Afternoon
2.00Practical session
4.00End of course

For multiple tables it may help to draw yourself a diagram before plunging into the HTML — or maybe just looking at the lines will make everything clear.  It may also help to work from the inside out.  Don't worry about all the lines — using CSS you can get rid of them.

The Center tag will centre the table, but it will probably? also centre all the table elements — depending on your browser.  Don't worry about that: I'll talk about DocType in Session 5 which should make things clearer!

To see the HTML I used to produce these two tables, right-click on the page (Control Click on a Mac) and on the drop-down menu click View Source or View Page Source.