W3C home > Mailing lists > Public > public-css-testsuite@w3.org > January 2012

[RC6] data-alignment-003 is imprecise

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Wed, 11 Jan 2012 18:57:49 -0800
Message-ID: <8ffe12027ac0f8e48a5c1b3f3356dc63.squirrel@gtalbot.org>
To: "Arron Eicholz" <arron.eicholz@microsoft.com>
Cc: "Public CSS test suite mailing list" <public-css-testsuite@w3.org>



line 8         <meta name="assert" content="Cell data in a row can be
horizontally and vertically aligned." />

line 9         <style type="text/css">

line 10             tr

line 11             {

line 12                 vertical-align: middle;

line 13                 text-align: center;

line 14             }

The meta assert text and the CSS code assume (and more or less state,
without nuance, without necessary precautions) that vertical-align can
apply to tr elements and, because it may seem to apply, td cells will be
vertically aligned accordingly. But, that is not so.

The given code works because most, if not all, user agents have in their
default user agent stylesheet

thead, tbody,
tfoot           { vertical-align: middle }
td, th, tr      { vertical-align: inherit }
Appendix D. Default style sheet for HTML 4

or they may have

td, th      { vertical-align: middle }
according to
Internet Explorer User Agent Style Sheets

Setting directly 'vertical-align: middle' into the td rule would be okay.

What is currently missing in the test code is an explicit inheritance in
the test code (and not relying on the user agent default stylesheet)
because vertical-align does *not* apply to tr elements and
vertical-align is not inherited.

Proposed correction

    10             tr

    11             {

    12                 text-align: center;

    13             }

    14             td

    15             {

    16                 vertical-align: middle;

    17                 width: 10em;

    18                 height: 10em;

    19                 border: solid;

    20             }

Another idea would be to add 'vertical-align: inherit' (explicit and
active inheritance from tr to td in author stylesheet) into the td rule
of current code.

The text assert could also be a bit more careful by stating that
vertically aligning cell data can only be done at the cell level and not
at the row level... and be perfectly coherent with the spec and

regards, Gérard
Contributions to the CSS 2.1 test suite:

CSS 2.1 Test suite RC6, March 23rd 2011:

CSS 2.1 test suite harness:

Contributing to to CSS 2.1 test suite:
Received on Thursday, 12 January 2012 02:58:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:17 UTC