HTML and CSS Reference
Page layout using a
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
1024. To prevent this display issue, use the align attribute (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 cellspacing and cellpadding
attributes on the table tag were changed. This layout uses cellspacing set to 0 and
cellpadding set to 10 . Note how the cellspacing value of 0 merges the table cell
backgrounds while the cellpadding value configures additional empty space around the
text. Examine the source code in the student files (Chapter8/tables/table1a.html).
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.
Focus on Accessibility