HighDots Forums  

col element in table not working

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss col element in table not working in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Haines Brown
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 07:56 AM






Christoph Paeper <crissov2003Q4 (AT) gmx (DOT) net> writes:

Quote:
*Haines Brown* <brownh (AT) teufel (DOT) hartford-hwp.com>:
Christoph Paeper <crissov2003Q4 (AT) gmx (DOT) net> writes:

Such changes more often happen with classes over time than with ids,
but why not be consistent?
Not to be argumentative, but why be consistent? I think of ID as
something specific to this particular document and a unique instance,
while class is generic and employed for multiple instances. So if they
are opposite in purpose, why should they be consistent in form?

That's why I tend to be very ad hoc when it comes to the ID
("SecondParagraphPadding-top," "indent2em", etc.), hinting its
specific location or purpose (well, not as ugly as the examples). I
don't want to be generic here.

I'm all in favor of consistency, but not when it comes to things that
refer to unique instances. What do you think?

--
Haines Brown
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com



Reply With Quote
  #12  
Old   
Anne van Kesteren
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 08:43 AM






Haines Brown wrote:

Quote:
[snip]

Not to be argumentative, but why be consistent? I think of ID as
something specific to this particular document
So wrong, CSS is invented to be applied to multiple documents. Each
document can have the _same_ ID attirbute.

Quote:
So if they are opposite in purpose, why should they be consistent in
form?

They should have a name that describes the elements content. It is about
markup, not about styling.

Quote:
That's why I tend to be very ad hoc when it comes to the ID
("SecondParagraphPadding-top," "indent2em", etc.), hinting its
specific location or purpose (well, not as ugly as the examples). I
don't want to be generic here.
That is stupid. What if your boss wants <p id="green"/> to be 'yellow'?
You will have to change the markup in such a case, where it would be
better to just describe the content.

--
Anne van Kesteren
<http://www.annevankesteren.nl/>


Reply With Quote
  #13  
Old   
Haines Brown
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 02:48 PM



Anne van Kesteren <mail (AT) annevankesteren (DOT) nl> writes:

Quote:
Haines Brown wrote:

Not to be argumentative, but why be consistent? I think of ID as
something specific to this particular document

So wrong, CSS is invented to be applied to multiple documents. Each
document can have the _same_ ID attirbute.
Well, yes, it is true that two different documents might use the same
ID name, but each ID must still refer to a specific instance, as far
as I know.

Quote:
They should have a name that describes the elements content. It is
about markup, not about styling.
I understand what you are saying. CSS is intended to define the format
of functional elements within a document, and so attributes are
associated with functional identifiers. For example, the functional
identifier of a main heading is <h1> and so we apply attributes to h1,
not to the text that happens to be enclosed by <h1></h1>.

However, not everyingthing has a function, and so how do we accomodate
CSS to other needs, such as aesthetics?

If I want some text to be green, say, for aesthetic reasons without
having green text mean anything, then then I'm faced with defining
format (or "style" as you put it) of the text itself. That may not be
the strength and basic purpose of CSS, but CSS does the job.

It may be that you are talking about principle, and I'm talking about
some practical needs that are hard to reconcile with the principle.

Quote:
That is stupid. What if your boss wants <p id="green"/> to be
'yellow'? You will have to change the markup in such a case, where
it would be better to just describe the content.
That's true. But does it not presume the paragraph here has a
specific function? In otherwords, what would you substitute for the
word "green" if you knew nothing about the paragraph in question? If
my concern were merely format or aesthetics, then I must somehow ask
CSS to provide the needed service.

In principle, I suppose, I could do something like <span
class="Z1">this</span>.

#Z1 {color: green;}

Here I'm not using a name that has any meaning in relation to the span
content, but is abstract, for the text has no particular function. Am
I better off using an abstract name like Z1 than something that is
meaningful to me, such as <span id="SecondExample">this</span>?

I hope all this does not seem too trivial to worry much about.

--
Haines Brown
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com



Reply With Quote
  #14  
Old   
Neal
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 05:10 PM




"Haines Brown" <brownh (AT) teufel (DOT) hartford-hwp.com> wrote

Quote:
If I want some text to be green, say, for aesthetic reasons without
having green text mean anything, then then I'm faced with defining
format (or "style" as you put it) of the text itself. That may not be
the strength and basic purpose of CSS, but CSS does the job.
Why do you want the text green? What is significant about the text? I think
Anne is saying that you should try to make names reflect the content, not
the style, so that you don't confuse yourself later.

For overall good design, making text green should be done for more of a
reason than "I felt like it" - perhaps "this text is showing the price of
something on sale, so I want it green" is more accurate. Or "this paragraph
is a sick joke and should be green in color." So your class or id ought to
be "saleprice" or "sickjoke." That way, down the road if the colors ought to
change, you're not stuck having your "green" elements being yellow or olive.

Quote:
In otherwords, what would you substitute for the
word "green" if you knew nothing about the paragraph in question?
If I didn't know the function, I shouldn't be screwing with the colors,
that's what I gather. Anne's point seems to be that the HTML markup should
not be tied to the visually artistic part of design. If you change font or
add color or whatnot, you should be doing it to differentiate the content
you're marking from content that's marked differently, not because you want
a pretty color.

I'm not saying I agree 100%, but that seems to be Anne's point, and it's a
well-reasoned one.





Reply With Quote
  #15  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 05:53 PM



On Wed, 17 Dec 2003, Haines Brown wrote:

Quote:
So wrong, CSS is invented to be applied to multiple documents. Each
document can have the _same_ ID attirbute.

Well, yes, it is true that two different documents might use the same
ID name, but each ID must still refer to a specific instance, as far
as I know.
Web pages tend to have quite a lot in common. There's no point in
inventing a new name for every banner head, for every navigation area,
for every copyright notice. And by keeping consistent, you can keep
the site looking consistent, and make consistent changes with minimum
effort. But you know this already, right?

Sure, there will also be items on pages that are not typical of
anything found on other pages, but that doesn't stop one from being
consistent when it's possible to be consistent.

Quote:
If I want some text to be green, say, for aesthetic reasons without
having green text mean anything, then then I'm faced with defining
format (or "style" as you put it) of the text itself.
If you've no other reason than "aesthetic reasons", then surely it's
just as likely to change at some other time, maybe to reflect autumn
gold rather than spring green? You might as well name the style as
something meaningless, say "cairngorm" or "fishpaste" or whatever, as
call it "green" and risk it being inappropriate when there's a change.

Quote:
That is stupid. What if your boss wants <p id="green"/> to be
'yellow'? You will have to change the markup in such a case, where
it would be better to just describe the content.

That's true. But does it not presume the paragraph here has a
specific function?
I don't think so. Even bosses have been known to have an inexplicable
fad for a colour change, without any specific function ;-)

Quote:
I hope all this does not seem too trivial to worry much about.
Welcome to usenet ;-))


Reply With Quote
  #16  
Old   
Haines Brown
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 08:49 PM



Thanks for the comments. Again, I'm carrying this on not to be
insistant, but to explore more deeply an issue that I find a bit
unclear.

"Neal" <neal (AT) spamrcn (DOT) com> writes:

Quote:
If I want some text to be green, say, for aesthetic reasons
without having green text mean anything, then then I'm faced with
defining format (or "style" as you put it) of the text
itself. That may not be the strength and basic purpose of CSS, but
CSS does the job.

Why do you want the text green?
As I said, for aesthetic reasons, but your example below leads me to
think maybe I can find more appropriate names.

Here are two examples.

Suppose I have an object that casts a shadow. The shadow graphic must
be placed carefully in relation to the object that casts it, but the
shadow has no function in relation to the body content. Suppose I'm
writing an advertisement for avocados, and so want the text to be
avacado green, and I want some other text to be orange because that's
nice color combination.

But you suggest:

Quote:
For overall good design, making text green should be done for more
of a reason than "I felt like it" - perhaps "this text is showing
the price of something on sale, so I want it green" is more
accurate. Or "this paragraph is a sick joke and should be green in
color." So your class or id ought to be "saleprice" or "sickjoke."
That way, down the road if the colors ought to change, you're not
stuck having your "green" elements being yellow or olive.
OK, so the name you would recommend in the above example would be
id="avocado", and so then I'm free to alter the color of avocados as
I will. Or <img id="shadow /> Or id="PrettyText" perhaps.

But let me raise a practical question. Suppose I have something lke
this, whic is a list of links prefaced by an arrow graphic:

<p class="links" id="child">
<img class="arrow" src="../bin/arrow.png" alt=" " />
<a href="doc-a.html">child a</a>
<br />
<img class="arrow" src="../bin/arrow.png" alt=" " />
<a href="doc-b.html">child b</a>
<br />
<img class="arrow" src="../bin/arrow.png" alt=" " />
<a href="doc-1.html">child 1</a>
</p>

Now, let's assume there's a categorical distinction between the child
links that are listed alphabetically, and the one listed numerically,
and so a want to insert, say 0.4em; padding between the second and
third link. What would you recommend? This actually lies behind why I
raised the issue in the first place.

--
Haines Brown
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com



Reply With Quote
  #17  
Old   
Haines Brown
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 09:01 PM



"Alan J. Flavell" <flavell (AT) ph (DOT) gla.ac.uk> writes:

Quote:
On Wed, 17 Dec 2003, Haines Brown wrote:

So wrong, CSS is invented to be applied to multiple
documents. Each document can have the _same_ ID attirbute.

Well, yes, it is true that two different documents might use the
same ID name, but each ID must still refer to a specific instance,
as far as I know.

Web pages tend to have quite a lot in common. There's no point in
inventing a new name for every banner head, for every navigation
area, for every copyright notice. And by keeping consistent, you
can keep the site looking consistent, and make consistent changes
with minimum effort. But you know this already, right?

Sure, there will also be items on pages that are not typical of
anything found on other pages, but that doesn't stop one from being
consistent when it's possible to be consistent.
You jump at this point to discuss the subject I just debated in my
previous mewssage, so won't burden you with it here. I think I
concluded that in principle one should use names that refer to the
function or identification of the content rather than its format, so
Anne is probably right. If I cook up a strange example where that is
not true, I can certainly use an abstract identifier (id="Z1") that at
least does not violate the principle.

However, your point above seems to be left hanging. Yes, one should
try to be consistent. However, how is one consistent in dealing with
something unique? For example, we try to make our pages uniform, but
often I've made pages that have little in common with anything else,
and which do not have many repeated elements in them. This is where
id= comes in.

But I'm having difficulty understanding how one can be consistent
about what is unique. I can think of one or more answers to this
question, but wonder what you had in mind.

--
Haines Brown
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com



Reply With Quote
  #18  
Old   
Christoph Paeper
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 09:24 PM



*Haines Brown*:
Quote:
whic is a list of links prefaced by an arrow graphic:
It's not, at least in HTML terms.

Quote:
p class="links" id="child"
img class="arrow" src="../bin/arrow.png" alt=" " /
a href="doc-a.html">child a</a><br /
img class="arrow" src="../bin/arrow.png" alt=" " /
a href="doc-b.html">child b</a><br /
img class="arrow" src="../bin/arrow.png" alt=" " /
a href="doc-1.html">child 1</a
/p

Now, let's assume there's a categorical distinction between the child
links that are listed alphabetically, and the one listed numerically,
and so a want to insert, say 0.4em; padding between the second and
third link. What would you recommend?
<ol class="links" id="child">
<li><a href="doc-a.html">child a</a></li>
<li><a href="doc-b.html">child b</a></li>
</ol><ol class="links">
<li><a href="doc-1.html">child 1</a></li>
</ol>

.links {list-style: disc url("../bin/arrow.png");
margin: 0; padding: 0.2em 0}

--
"Opportunity is missed by most people
because it is dressed in overalls and looks like work."
Thomas Alva Edison


Reply With Quote
  #19  
Old   
Neal
 
Posts: n/a

Default Re: col element in table not working - 12-17-2003 , 09:29 PM




"Haines Brown" <brownh (AT) teufel (DOT) hartford-hwp.com> wrote

Quote:
But let me raise a practical question. Suppose I have something lke
this, whic is a list of links prefaced by an arrow graphic:

p class="links" id="child"
img class="arrow" src="../bin/arrow.png" alt=" " /
a href="doc-a.html">child a</a
br /
img class="arrow" src="../bin/arrow.png" alt=" " /
a href="doc-b.html">child b</a
br /
img class="arrow" src="../bin/arrow.png" alt=" " /
a href="doc-1.html">child 1</a
/p
Well, there is:

list-style-image: url(URI);

where URI is the location of an image that serves as a bullet.

Quote:
Now, let's assume there's a categorical distinction between the child
links that are listed alphabetically,
What is that distinction? I'll use "one" and "two" as placeholders.

Quote:
and the one listed numerically,
and so a want to insert, say 0.4em; padding between the second and
third link. What would you recommend? This actually lies behind why I
raised the issue in the first place.
li.one, li.two {
list-style-image: url(arrow.png);
padding: 1em;
}

li.two {
padding-top: 1.4em;
padding-bottom: 1.4em;
}

<ul>
<li class="one"><a href="doc-a.html">child a</a></li>
<li class="one"><a href="doc-b.html">child b</a></li>
<li class="two"><a href="doc-1.html">child 1</a></li>
</ul>

Or, you could do two ul's in a row, and set the ul padding .4 em larger than
the padding between li's. Actually, I think that might be better.




Reply With Quote
  #20  
Old   
Haines Brown
 
Posts: n/a

Default Re: col element in table not working - 12-18-2003 , 06:48 AM



Yes, you and Neal provided obvious answers, but only by changing the
parameters of the question. I was avoiding a "list" in HTML terms, but
instread created one in terms of its format. My example used lines
separated by <br /> because such lines are not contained in an element
that can be identified.

I could also have divided my example list into separate paragraphs,
identify one of them, and then play with their spacing. You and Neal
divide my list into two lists, and so can identify them with the names
"child" and "links". Both are functional names, which satisfies the
naming convention. But note that all the list items are simultaneously
a child and a link, and so I suppose child-a and child-b is their
equivalent. Neal does this with link-1 and link-2.

These names are essentially abstract distinctions among links and
therefore not much different from my purely abstract example of
"Z1". Such a name satisfies the recommendation that names _not_
reflect format, but fail to satisfy the recommendation that names do
_distinguish_ function or content.

Why I offered an example with lines separated by <br /> is that the
lines have no container that can be so identified. I've found through
playing that I can do something like this

#vspace { line-height: 2em; }

Line 1
<br />
Line 2
<br id="vspace" />
Line 3

This creates extra space between Line 1 and Line 2. However, I've
never used this because I'm not sure all browsers will associate the
<br /> with Line 2 and so give their shared line the extra height
instead oif Line 3. But the question is, the name "vspace" here does
in a sense refer to a kind of content, although also format, just as
<br /> itself does. So is "vspace" acceptable as a name? This may be
the same as my <img id="shadow"... /> example.

Again, sorry to pursue a picky question at such length, but I find
that issues that are not driven into the ground have a way of biting
me in the butt when I'm not looking.

--
Haines Brown
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.