473,769 Members | 2,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<colgroup><co l class="behold"> </colgroup>

The only browser I have encountered that supports
<colgroup><co l class="behold"> </colgroup>
to apply a CSS style to a whole column, is Microsoft Internet
Explorer. I have been told it SHOULD NOT do so, since this is not
part of the specification.

How then to you apply styles to entire columns? Surely you don't have
to write

<td class="behold"o n every row item.

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Aug 2 '08
36 5108
Roedy Green schrieb:
I am a bit frustrated that nobody seems to acknowledge that being able
to specify color:red on a column is not anywhere near as useful as
being able to say class="strawber ry" for a column.
Of course you can 'say class="strawber ry" for a column'. But the CSS
specification allows only very few properties to be applied to column
and column-group elements. Whether you apply properties via a inline,
internal or external style is not relevant.
The whole point of CSS is to control
s/control/suggest/
your layouts, colours and fonts
in the style sheet, not with specific commands embedded in the
documents.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 14 '08 #21
Jonathan N. Little wrote:
I think you will find the problem is that the COL element does not
really "contain" any of the elements that you are trying to style. Kind
of counter to how CSS works.
I've found that most of CSS is counter to how CSS works once you are
inside a table. It's almost as though the designers wanted to push DIVs
in place of tables, so glossed over table support.

The one that bit me was expecting styling applied to a TR tag to be
inherited by the enclosed TD tags. I was gung-ho for migration to CSS
before I fell foul of this. I'm less enthusiastic now.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Aug 14 '08 #22
In article <aPimk.305$_H1. 189@trnddc05>,
Joshua Cranmer <Pi*******@veri zon.invalidwrot e:
David C. Stone wrote:
That's where there has been long and endless debate on the Bugzilla
system around why Firefox hasn't implemented CSS for tables the
way it is actually described in the CSS documents. Supposedly, a
fix is FINALLY in the works, but I'm not holding my breath. Oddly,
it's one of the few areas where IE more-or-less does what the specs
say...

In a quest to stop the spread of misinformation:
1. The bug in question is to support styling of columns via the HTML
presentational attributes.
2. The parent's reference to limited CSS column styling is, in fact correct.
3. To my knowledge, FF does support that part correctly.
4. IE does not do what the spec does, as Hixie outlines on his blog, the
link to which is included in one of my other posts on this thread.
There is an example of using html+css to format a column of numbers
in such a way that the values are all aligned at the decimal point.
I tried replicating this example, and neither versions 1.5 nor 2.x
of FireFox would produce the results as shown in the CSS specs. I
haven't tried it since, and I haven't downloaded version 3 yet, so
I don't know if this has been fixed yet...
Aug 14 '08 #23
On Wed, 13 Aug 2008 23:48:37 -0400, "Jonathan N. Little"
<lw*****@centra l.netwrote, quoted or indirectly quoted someone who
said :

>I think you will find the problem is that the COL element does not
really "contain" any of the elements that you are trying to style. Kind
of counter to how CSS works
But that is defect that needs to be correct, not excused.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Aug 14 '08 #24
Roedy Green wrote:
Roedy Green wrote:
On Wed, 13 Aug 2008 23:48:37 -0400, "Jonathan N. Little"
<lw*****@centra l.netwrote, quoted or indirectly quoted someone who
said :

>I think you will find the problem is that the COL element does not
really "contain" any of the elements that you are trying to style. Kind
of counter to how CSS works

But that is defect that needs to be correct, not excused.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorks Studio.comOn Wed, 13 Aug 2008 23:48:37 -0400,
"Jonathan N. Little"
<lw*****@centra l.netwrote, quoted or indirectly quoted someone who
said :

>I think you will find the problem is that the COL element does not
really "contain" any of the elements that you are trying to style. Kind
of counter to how CSS works

But that is defect that needs to be correct, not excused.
Not in my opinion, COL and COLGROUP is basically a "presentational "
element like FONT.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Aug 15 '08 #25
Roedy Green wrote:
I think CSS column formatting is broken. I think it could be fixed
very simply by expanding the use of <colspan>.
No, this is because stuff happens at the wrong time. I've pointed you to
Hixie's post on the issue several times, but since you seem to not have
read it, I'll summarize for you.

First off, some background. CSS is based on a document format, so if it
can't be represented by the DOM (or, loosely, XML), it can't really be
done by CSS. I make this remark to hit one key point: an element cannot
have two parents.

CSS is also designed to be language-agnostic. That means that I should
be able to style an arbitrary XML file, instead of only HTML. Another
way to look at the issue is that a layout engine is an SGML parser that
has a default stylesheet with rules to specify how HTML works, at least
in terms of layout. So a <tableelement only acts that way because it
has "table { display: table; }".

The last thing to point out is this: CSS has a concept of inheritance.
For every element, every property is defined. If I don't have a (say)
color property, it's value then becomes inherited from its parent.

So we now parse the document. We get to a <td>. It has no color. So we
look at its parent, <tr>. It has no color. And we then look at its
parent, etc. Possibly we want to style from the column in this case, but
the column is not a parent of the cell. How can we possibly find it then?

I hear you muttering under your breath "you know what column it is in."
But you don't. Remember my second point? We don't know that because
we're at the end of the selector process. We need to know what the
element will look like before we start laying it out--the /computed
style/ of the element. To know the column from which to apply the
styles, we need to lay out the table, but we need to know the computed
style before then.

This "works" in IE because IE doesn't implement CSS correctly. It
doesn't do computed styles, which destroys a POWERFUL feature for one of
admittedly less use.

The four attributes that do work work because they're really special
containers. You can see them as a sort of ruling structure to put the
cells in the right place, so only things that affect the ruling work
(border puts a border along the rules, background puts a background that
could be covered up, width specifies the width of the rules, and
visibility: collapse hides the rules).

You'll see that the core problem here immediately relates back to the
fact that a cell /should/ have two parents, but the format it's
expressed in forbids this from happening.

There is one last thing to rebut: the idea of having some sort of "get
this attribute from the column" keyword value. Logically, this would
first do one thing: slow the layout dramatically, since you have to
crawl up stuff to find the column in which the cell is going to be
placed *and* its parental hierarchy. For every cell that has that
property. And, given developers, I think a lot of people will make this
true for all cells whether or not they need it. Which means this will
happen for every cell on every table on pages.

It would also break computed styles, since the style is being computed
at layout time and not parse time.

Sure, tables and CSS don't mix well. Part of that is because tables
don't work well in the DOM hierarchy. If you read the HTML spec, you'll
find that the only things that inherit there is alignment (the style
portion is overridden by CSS 2.1).

And it's <colgroup>, not <colspan:-)
<tr>...</tr>
<colspan<col class="behold"</colspan-- applies to rest body
<tr>...</tr>
Let me explain why this is bad.

First off, that implies that a <colgroupis "reset" by seeing another
one. You've just broken backwards compatibility big time there.

Second, colgroup is a group of columns. Keeping that in mind, that means
that the reset creates a new group of columns. Which means that you now
have new columns. Things like changing the width, etc., can now be
respecified, thereby making, effectively, a new table.

Complain to the W3C CSS list. Complain to the WHATWG list. I think
you'll find reception of these ideas among the spec-writers will be very
poor. Not because they're evil, but because it turns out to be
real-world impractical.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Aug 16 '08 #26
Joshua Cranmer wrote:
The last thing to point out is this: CSS has a concept of inheritance.
It is one of the most misunderstood concepts that I ever heard of. The great
majority of statements relating to inheritance in CSS are wrong, based on
misunderstandin g; the rest will be misunderstood by most people.
For every element, every property is defined.
Yes. But not every property is inherited.
If I don't have a (say)
color property, it's value then becomes inherited from its parent.
If your style sheet does not assign a value for a property of an element,
then the property still gets a value, but by cascade rules. Primarily, a
value specified in some other style sheet being applied will be used, by
certain priority rules. For example, a user style sheet might have
* { color: white; background: black; }

Only when _no_ style sheet (even a browser's default style sheet, which
might in principle contain just anything) assigns a value to a property for
an element will inheritance be considered. Even then, inheritance will take
place only if the property is defined as inherited in CSS specifications (as
the color property is). If it is not, the so-called initial value (as
defined for the property in CSS specs) will be used.
Sure, tables and CSS don't mix well.
That's another difficult topic, and it's really caused by fundamental design
problems in HTML _and_ in CSS.

Yucca

Aug 16 '08 #27
"Jukka K. Korpela" <jk******@cs.tu t.fiwrites:
Primarily, a value specified in some other style sheet being
applied will be used, by certain priority rules.
It's called "specificit y," not "priority." Please refrain from giving
advice concerning something about which you have no clue.

<http://www.w3.org/TR/CSS21/cascade.html#sp ecificity>

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Aug 16 '08 #28
Jukka K. Korpela wrote:
Joshua Cranmer wrote:
>The last thing to point out is this: CSS has a concept of inheritance.

It is one of the most misunderstood concepts that I ever heard of. The
great majority of statements relating to inheritance in CSS are wrong,
based on misunderstandin g; the rest will be misunderstood by most people.
The inherit keyword is what does this. I was omitting that for the sake
of simplicity. But many properties are inherited, and it is these
properties that are in question, since the goal is to provide for
columns what a <tr class=""will do for rows.

So, for inherited properties, there is a concept of inheritance. And we
don't care about non-inherited properties right now...
>For every element, every property is defined.

Yes. But not every property is inherited.
Again, omission for simplicity. Many of the important properties that
one would wish to style are, in fact, inherited.
If your style sheet does not assign a value for a property of an
element, then the property still gets a value, but by cascade rules.
I'm referring to after the cascade. This is probably the case most of
the time.
Even then, inheritance
will take place only if the property is defined as inherited in CSS
specifications (as the color property is). If it is not, the so-called
initial value (as defined for the property in CSS specs) will be used.
Again, I'm omitting for simplicity.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Aug 16 '08 #29
On 2008-08-16, Jukka K. Korpela <jk******@cs.tu t.fiwrote:
[...]
Only when _no_ style sheet (even a browser's default style sheet, which
might in principle contain just anything) assigns a value to a property for
an element will inheritance be considered.
Or when a stylesheet assigns the value "inherit" (but "inherit" can only
be used for some properties).

For the sake of completeness I point out that inheritance is also
considered in some cases when properties are applied to CSS boxes that
don't correspond to HTML elements.

Anonymous inline and block boxes inherit inheritable properties from
their block parents.

Anonymous table objects I'm not sure about. I can't see where in the
spec it says that they should inherit inheritable properties, but I just
tried a test and it seems they do in Firefox, Opera and Konqueror.

http://www.tidraso.co.uk/misc/anonTableInheritance.html
Aug 16 '08 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.