PDA

View Full Version : Caption oddity - just rendering glitches?


beetle
06-19-2003, 07:03 PM
on this page (http://www.peterbailey.net/fvalidate/nu/compatibility/), I have a table that is centered using the CSS margin: 0 auto; which works fine in the browsers I expect it to. The caption also uses the CSS2 caption-side: bottom; which works in Moz & Opera - but not without each having a particular oddity.

Mozilla (1.3.1) puts the caption at the bottom, but the caption doesn't 'stick' to the table - that is - it appears where the table would be had I not centered it.

Opera (7) puts the caption below the table, FAR below. The gap seems to be near twice the height of the table.

Here's the CSS for the caption and the table

/* Tables */
table {
border-collapse: collapse;
position: relative;
margin: 0 auto;
}
table caption {
color: #999;
text-align: right;
font-style: italic;
caption-side: bottom;
}
table th {
background-color: #559;
color: #FFF;
}
table td {
background-color: #FFF;
}
table td, table th {
padding: .2em .5em;
border: 1px solid #CCD;
}
/* Compatibility Table */
table#compat td.family {
background-color: #EEE;
font-weight: bold;
color: #C00;
}
Any clues? I can live with Mozilla offing the caption - but Opera's behavior is hard to swallow.

brothercake
06-19-2003, 07:20 PM
What occured to me is prolly not that helpful, but here you go:

There's a usability issue in having the caption at the bottom - you want to know what it is before you look through, not after, and since it's a long table you don't see it until you've scrolled; iirc the unstyled placement of a caption is center-aligned above the table - I'd stick with that, or maybe left-align the text

beetle
06-19-2003, 07:24 PM
Interesting point there, bcake. And a good one at that. I'll have to chew on it a bit.

beetle
06-19-2003, 08:44 PM
Well, after some thought, I've decided to top/left align the caption. For one, I just couldn't live with Opera's output.

But primarily, because I thought about what you said and agree. This was certainly one of those "bothering with how, but failing to ask why" situations.

Thanks bcake :thumbsup: