HTML and CSS Reference
In-Depth Information
Formatting a Table Caption with CSS
• To position a table caption, apply the property
caption-side: position ;
where position is top or bottom .
Add this style to the tables.css style sheet.
To apply a style to the table caption:
1. Return to the tables.css file in your text editor and add the following style rule to
the bottom of the file (see Figure 5-47):
/* Styles for the table caption */
table.schedule caption {
caption-side: bottom;
text-align: right;
}
Figure 5-47
Setting the caption position
displays the caption
in the bottom-right
corner of the table
2. Save your changes and then reload the schedule.htm file in your Web browser.
As shown in Figure 5-48, the caption should now appear in the bottom-right cor-
ner of the table.
Figure 5-48
Table caption in the bottom-right corner
Search WWH ::




Custom Search