W3C home > Mailing lists > Public > www-style@w3.org > July 2015

Re: [selectors][css-syntax] Allow comma-separated lists of An+B?

From: Markus A.O. Loponen <codewallah@gmail.com>
Date: Tue, 23 Jun 2015 07:12:04 +0000
Message-ID: <CAKmJP4iUJkkvoo41EQYoGW7t-hDL3NTQR=D2KfOtxMpe9dUpCg@mail.gmail.com>
To: www-style@w3.org
I appreciate that a long list of (possibly conflicting) nth-patterns may
result in complex parsing.  With integers only, I imagine it should be dead
simple. To eliminate the need to look for lists in each nth-pseudo, the
following list syntax could be used: td:nth-of-type( [1,4,6,9,11] ).

This addition to the standard would make it very expedient to style e.g.
table cells in a situation where one has diverse tabular datasets with
varying amounts and orders of columns; and where some columns require
custom styling, e.g. for the text to be bold or centered. (Which would be
quite a common scenario.)

Currently there is no convenient way to accomplish this, aside repeating
the full path of nth-rules for each targeted instance. If I have to deal
with dozens of tables, this leads to a lot of CSS bulk, and is more
cumbersome than a simple list to quickly pin-point and edit, where the HTML
data order may change. Especially if I have to reflect the TD styling in
the corresponding THs as well.

Unfortunately the COL tag, which would otherwise be perfect for styling
table cells per column, cannot impact most of the styles in a TD. Again,
adding a separate class attribute to each TD creates +200% of HTML bulk
compared to just TD open-and-close tags.

Looking forward seeing this addition also in the upcoming "nth-column"
pseudo. :) Sincerely, "Lotsa Tab Datas".
Received on Friday, 10 July 2015 08:48:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:18 UTC