Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1

(^326) Chapter 8 Tables
Figure 8.20
Page layout using a
table
The  character is coded in the table displayed by Figure 8.20 as a placeholder in
the cell used for a spacer. Recall from Chapter 2 that  is a special character that
creates a nonbreaking space.
The alignment of the table will be to the left by default. This can sometimes make the
page look unbalanced when it is viewed with a monitor set to a higher resolution, such
as 1280×1024. To prevent this display issue, use the alignattribute (or CSS as
described later in the chapter) to center the table. Assign the table a percentage width of
the Web page. These techniques will cause all browsers of varying resolutions to display
the table centered and extended across 80 percent of the Web page.
Figure 8.21 shows a similar Web page layout—only the cellspacingand cellpadding
attributes on the table tag were changed. This layout uses cellspacingset to 0 and
cellpaddingset to 10. Note how the cellspacingvalue of 0 merges the table cell
backgrounds while the cellpaddingvalue configures additional empty space around the
text. Examine the source code in the student files (Chapter8/tables/table1a.html).


Accessibility and Layout Tables


You’ve become aware that tables are often used to configure Web page layouts on the
Web. This technique has been used for years. When using a table in this manner it is
important to understand that screen readers and other assistive technologies typically
access a table in a linear manner—that is, they “read” the table row by row.

WWW


Focus on Accessibility

Free download pdf