RE: [WSG] Table width in Firefox - Strange problem

2005-10-21 Thread Peter Williams
 From: CHAUDHRY, Bhuvnesh
 
 ...in Firefox 1.0.7. The Caption totally ignores the specified width
 of the table extends to the full width of the page.
 
 .try {
   background-color: #CC;
   border: thin solid #CC9900;
   padding: 4px;
   margin-left:30%; 
   margin-right:30%;
   width: 40%;
 }
 caption {
   font: bold 120% Arial,sans-serif;
   padding: 3px 0px 3px 0px;
   border-top: thin solid #CC9900;
   border-left: thin solid #CC9900;
   border-right: thin solid #CC9900;
 }

 table cellpadding=0 cellspacing=0 class=try
 captionChair/caption
   tr
 thYear/th
 thCountry/th
   /tr
 SNIP
 /table

If you add the same width and margin declarations to the caption it
works.
margin-left:30%;
margin-right:30%;
width: 40%;

If you apply only the width you'll see that the caption begins at the
left
edge of the body, not at the left edge of the table. It seems that the
caption is not being contained by the table in FF, but I can't explain
why.

-- 
Peter Williams
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



RE: [WSG] Table width in Firefox - Strange problem

2005-10-21 Thread Peter Williams
 From: Peter Williams

 It seems that the caption is not being contained by the
 table in FF, but I can't explain why.

HTML 4 recommendation has this to say about the caption element:
Visual user agents should avoid clipping any part of the table
 including the caption, unless a means is provided to access
 all parts, e.g., by horizontal or vertical scrolling. We
 recommend that the caption text be wrapped to the same width
 as the table.

So the caption isn't forced to be the same width as the table.

I tried it in the latest Opera browser and found that it works
as you wish without the extra rules, and is actually broken
with the extra rules in place (unlike IE6 which showed it as
you wanted with either set of rules in place).

-- 
Peter Williams

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**