Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Table Parts 247

10


10
20


Captions


Table captions tell your visitor what the table is for. The element, created just
for this purpose, displays the text inside the tag as the table caption (usually centered
above the table). Although you could use a regular paragraph or a heading as a caption
for your table, tools that process HTML files can extract elements into a
separate file, automatically number them, or treat them in special ways simply because
they’re captions.


If you don’t want a caption, it’s optional. If your table is under-
standable without a caption or you have described it in some
other location, you can leave it off.

NOTE

The element goes inside the

element just before the table rows, and it
contains the title of the table. It closes with the tag:





You can include details inside a caption to provide additional information about the table
that is hidden by default. When you include details, you need to also include a sum-
mary that acts as a title for the additional details. Chrome, Safari, and Opera all support
showing and hiding content with the and

tags. You can use the


and tags inside the

Figure 10.3 shows a element that has been clicked on to show the hidden
content.

Vital Statistics
tag:


Vital Statistics

This table includes the name, height, and, weight of various employees.