W3C home > Mailing lists > Public > www-style@w3.org > April 2005

CSS2.1 (caption, float, vertical-align)

From: w.szukalski <szukw000@students.uni-mainz.de>
Date: Sun, 24 Apr 2005 06:19:35 +0000
To: <www-style@w3.org>
Message-ID: <20050422064008.A4045@keun>

I feel, the specification has some weaknesses.

Weakness number one:

Section 17.4 states: "In both cases, the table element
  generates an anonymous box that contains the table box
  itself and the caption's box (if present). The table
  and caption boxes retain their own content, padding,
  margin and border areas, and the dimensions of the 
  rectangular anonymous box are the smallest required to
  contain both.

Test e.g.:

<table style="width:200px; margin:50px;">
<caption style="width:400px:">Caption text</caption>
<tr><td>cell ONE</td></tr>

The anonymous box has no alignment: the caption's text
is centered by default. The table (possibly) is left 
aligned within the anonymous box.

The caption's text is 50px distant from the table, although
the margin of an element should generate a free area between
the element itself and the environment. Which means: the
caption belongs to the environment, not to the table. But:
the width of the caption may decide where the table is placed.

One could write:

<table style="width:200px; 
	margin-bottom:50px;margin-left:50px; margin-right:50px;">
<caption style="width: 200px;
	margin-left:50px; margin-right:50px;
	margin-top:50px;">Caption text</caption>
<tr><td>cell ONE</td></tr>

Changing 'align=top' to 'align=bottom' is not simple: the
user has to change two margins too. This discourages the
user to change the alignment.

And what happens when the table width is dynamic ?
'caption of table' becomes 'table of caption'.

A better solution would have been:

  The anonymous box gets the alignment and the margin
  of the table.

Then the user only has to change the caption's alignment

/* Annotation: I have made a test by using a wrapper
   table as an anoymous box.


 <table><tr><td>CAPTION TABLE</td></tr></table>


 <table><tr><td>TABLE CAPTION</td></tr></table>





   The wrapper table has no border, no padding, no spacing.  
   The wrapper table gets the margin, the alignment, and
   the width of the original table. If the original table
   has a relative width, the original table gets a width of
   100 %. I can switch between the four alignments simply
   by changing the alignment value of the caption element
   in the document.

Weakness number two:

Section 9.5, paragraph 4, lines 4ff. :

  Any content in the current line before a floated box is
  reflowed in the first available line on the other side
  of the float. 

The user can always force this behaviour, writing:

<img align=left> The image to the left shows ...

But when the user wants to write:

The image below <img align=left> shows ...

then the image actually is not below only because the
specification states: User, not I have to serve you, but
you have to serve me.

Weakness number three

Section 10.8

  'baseline of box' : 'baseline of parent box'

  'vertical midpoint of box' : 'baseline of parent box'

  'baseline of box'

  'baseline of box'

  'top of box' : 'top of font'

  'bottom of box' : 'bottom of font'

'text-top' and 'text-bottom' are undefined because a
'top of box' resp. 'bottom of box' does not exist. A
box is defined by edges (or lines) in Section 8. Top
of font (baseline - ascent) and bottom of font (baseline
+ descent) are well know.

One could define a 'topmost edge': the top margin edge
for margin-top >= 0, otherwise the top border edge.

'top' is defined only as the 'top' property. 'top',
'bottom', 'right', 'left' are directions: below, above,
left oft, right of (Section 9.3.2).

Last not least
o I want to point to the drawing of section 17.6.1 :
  the 'table width' does not include the border of
  of the table, but the cellspacing only.

  The first drawing in 17.6.2 shows correctly: the
  table width is the row width plus half the 
  border-left value plus half the border-right value,
  i.e. includes the vertical borders.

o Section 16.3 shows an image which does not show the
  reader how the implicit inheritance for the property
  text-decoration must work.
  A better solution is:

    <span>Blue text with blue underline.
      <em>Blue text without underline.</em>
      <cite>Fuchsia text with blue underline</cite>

o The definition of properties of the collapsing border
  model resp. the separated border model is imprecise.

  Section 17.6.1, paragraph 5, last line:
    Rows, row columns, row groups, and column groups
    cannot have borders ...

  'cannot' is not a keyword of Section 3.1 . You must
  either use 'must not have borders' or explain why a
  row 'cannot' have borders. In fact, a row 'can' have
  borders in the separated border model: if the row
  does not surround another row or is not surrounded
  with another row.

  'Padding' for a row is not mentioned at all.

  I propose the following clarification:
  1: MAY
  ?: Specification pulls my leg

                    separated model  collapsed model
  table margin           1               1
  table border           1               1
  table padding          1               0
  row border             ?               1
  row padding            ?               0
  cell spacing           1               0
  cell border            1               1
  cell padding           1               1

Received on Sunday, 24 April 2005 20:02:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:36 GMT