Re: text-align property for columns (once again)

On Wed, Apr 8, 2009 at 2:05 AM, regme please <regmeplease@gmail.com> wrote:
> 2009/4/7 Tab Atkins Jr. <jackalmage@gmail.com>
>> Well, the implementers already know the problems with it, but what
>> would you like to see for authors?
>>
>> ~TJ
>
> First of all, what'd be your interpretation for chapter 17.5.4?

I'd interpret it exactly as it sounds.  The text-align property
determines the horizontal alignment of the contents of a cell.  The
issue at hand, though, is where a cell can *inherit* a text-align
value from.  Normally elements inherit from their parents, and the
tree-based model of an HTML document allows an element to have only a
single parent.  Because of how the HTML table model works (which CSS
copied), the row is the natural parent of the cell.

It's certainly possible to define some form of conflict resolution
that allows you to 'inherit' values from multiple places, and that's
precisely what is done with the four properties that can be applied to
a <col> element - the drawing of cell borders, frex, depends on the
border-* values of potentially *many* elements.  But this is a
well-defined algorithm.

The issue is deciding what makes sense for arbitrary properties.  The
simple answer is to just use the normal CSS inheritance model, which
means that cells inherit all other properties from their rows (their
actual parents in the document), and ignore the columns.  You could
relatively easily reverse this, say by defining another global value,
similar to 'inherit' and 'initial'; something like 'inherit-column'
would tell the CSS engine that this cell needs to get the value of the
given property from its column instead of its row, once columns are
figured out.  That would work perfectly fine within CSS, as the cell
would have a value at all times.

Many of us feel that the :col() and :nth-col() pseudoclasses, though,
solve larger classes of problems more easily, and so they have a
better chance of being implemented.

> Implementers very often misunderstand the standards: just give a look at public
> bug tracking systems.
> Clearer statements with no ambiguity won't harm anyone.
>
> And what I expect (or would like to see) follows here.
> Rows and columns, besides their syntactic position in a byte stream
> (tables are 2D, streams are somehow 1D) should just be cell containers
> meant for grouping
> and ordering.
> You put the data in cells grouped and ordered by rows and columns.
> The style will define the appearance of everything with the aid of
> classes and ids
> assigned to cells, rows, columns.
> Define a default inheritance rule (any rule will be ok) and then allow
> for a user
> defined one.
>
> It seems to me that something goes here, something goes and something else
> needs both. Which is confusing, at least to me.
>
> In my case the HTML+CSS code is generated on the fly by software (as
> opposed to "authoring tools")  with a DB back end.
> Appearance and data come from different sources and a separation would
> simplify the design and the implementation a lot.
> In my mind anything that's not data is just style that should stay all together.

Believe me, I understand your pain.  ^_^  I'm a site author, not an
implementor; I contribute to this working group because I enjoy it and
want to push the future of CSS in a direction that helps me do my
work.  Styling table columns has caused me pain many times.  Luckily
there are some good ideas in the pipeline that will help out
tremendously in this regard.

> I'm not a W3 guru, of course, just putting my thoughts in an email
> while studying my own problems.
> Your answers here are very precious to me as they shed more light on this world.

Glad to help.  To be fair, the reason *why* styling table columns is
so difficult is pretty arcane.  It's not something that anyone should
be expected to understand without a significant amount of knowledge in
the details of how CSS works.  I had to ask a lot of questions (which
the various implementors on this list very graciously answered) to
grasp just what was going on when I first ventured into this topic.
So don't feel bad about getting your ideas shot down.  ^_^

~TJ

Received on Wednesday, 8 April 2009 15:00:07 UTC