The <caption> Tag

You can add a title or caption to your table by using a <caption> tag within a <table>. The default placement of the caption for Netscape and Internet Explorer is above the table and centered with it. The placement and alignment of the caption is controlled by special alignment attributes that differ between the browsers.

In Netscape and Mosaic, the align attribute accepts two values: top and bottom. These allow you to put the caption above or below the table. The default value is top.

Internet Explorer, on the other hand, uses the align attribute for horizontal placement of the caption. It accepts values of left, right, and center (the default). The vertical positioning of the caption in Internet Explorer is controlled by a special valign attribute, which accepts either top (the default) or bottom. Each browser ignores the attributes and values it does not accept.

Get Webmaster in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.