HTML5 and CSS 3 – Illustrated 2nd Ed. Instructor’s Manual: Unit H Page 8 of 12
• Tell students to be sure to always place the closing table tag in the proper location because omitting
or improperly placing the closing tag could result in data that is hard to read when rendered by a
browser.
TEACHER TIP
Make sure students understand the structure of the table code. Show students how to read the code
and as you do create a conceptual drawing of the table that will be created by the code.
FIGURES: H-17, H-18, H-19, H-20
BOXES:
1. Quick Tip: You can visualize the role of each element in a table by opening your browser’s
developer tools, then mousing over each element to highlight it on the page.
2. Quick Tip: The extra cell is narrower than the other cells because by default, browsers set width
to fit the content in the widest cell of a column.
3. Trouble: If your table does not match appear as expected, use FIGURE H-14, which shows the
completed code for the table, to correct any errors.
4. Clues to Use: Resisting the temptation to use tables for layout
You can style table borders with all the properties that are available for other web page
elements, including removing borders completely. In the early days of the web, many
developers combined spanned rows and columns with invisible borders to enable the
positioning of text, images, and other elements side by side, and in specific areas of a web page.
However, as CSS grew and user agent support for it matured, the CSS position and float
properties became the preferred method for creating visual layouts. While you can place
elements in arbitrary locations by manipulating the number and sizes of rows and columns in a
table, doing so erroneously assigns semantic meaning to your web page content; this suggests
that user agents should attempt to understand it as a table of related data. In addition, this use of
a table creates particularly strong challenges for non-visual user agents such as screen readers in
conveying the relationships between web page elements. For these reasons, you should restrict
your use of tables only to data whose meaning can be best understood in a grid layout.
CLASSROOM ACTIVITIES
1. Critical Thinking: Why tables were often used to layout web pages? Is this more efficient than using
CSS position and float properties? Why or why not? Explain.
2. Quick Quiz: