Forum Moderators: not2easy

Message Too Old, No Replies

Is the <caption> tag something to use?

Is caption more trouble than it's worth?

         

Storyman

4:09 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



If I use a table it is within Div IDs.

I was wondering if others are using the caption tag and what experiences have they had with it. Is it something to use or avoid?

drbrain

4:28 pm on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it is used as a caption for the table, I see no reason not to use it.

HTML 4.01 Section 11.2.2 Table Captions: The CAPTION element [w3.org]

When present, the CAPTION element's text should describe the nature of the table. The CAPTION element is only permitted immediately after the TABLE start tag. A TABLE element may only contain one CAPTION element.

Are you having any particular problems with it?

Remember to place the elements inside your table in the correct order:

caption?
(col*¦colgroup*)
thead?
tfoot?
tbody+

Note:? means 0 or 1, * means 0 or more, + means 1 or more

Storyman

4:38 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



Using DW MX 2004. When crating a table the program will insert a caption if desired.

The problem experienced is that IE6 shows the caption above the table, but Mozilla shows it to the left of the table.

The result is that because Mozilla inserts the caption to the left the table gets pushed to the right. Of course this won't do.

drbrain

5:15 pm on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In modern browsers you can control where the browser positions the caption with the caption-side CSS [w3.org] property. (Probably not supported in IE.)

caption {
caption-side: /* (top¦bottom¦left¦right¦inherit) */;
}