HighDots Forums  

TD CSS Shorthands... Thoughts?

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


Discuss TD CSS Shorthands... Thoughts? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Andy Dingley
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 01:42 PM






On Fri, 28 Apr 2006 10:52:33 -0700, Tony
<tony23 (AT) dslextreme (DOT) WHATISTHIS.com> wrote:

Quote:
If I can provide simple classes like .r { text-align:right; }
That's not pragmatic, it's f*&%ing stupid.



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

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 02:23 PM






On Fri, 28 Apr 2006, Tony wrote:

Quote:
Another pragmatic POV:

I write HTML, JavaScript & CSS as the client-side rendering, and
there are a team of developers who use what I write to make the
application work. If I can provide simple classes like .r {
text-align:right; } for them to place programatically as THEY need
it, it simplifies the work for everyone involved.
You're showing no indication of listening. In particular to the
principle of separation of content from presentation, as designed into
the HTML/CSS design. As such, it seems that further discussion with
you would be pointless, and I'll try to keep that in mind from now on.

Quote:
And if you store that class declaration as a constant, then all you
have to do is change that single constant to change the way the site
renders.
uh-uh, so next week you'd be happy to code stuff like:

.r { text-align: center; }

and

.blue { color: yellow; }

and so on?

Not for me, anyhow.


Reply With Quote
  #13  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 03:54 PM



kchayka wrote:
Quote:
Harlan Messinger wrote:
you want column headers to be bottom-center-aligned.

.colhead { text-align: center; vertical-align: bottom; }

Better would be to use proper column header markup, with <thead> and
th> elements. Then you may not need class selectors at all.
At least not for headers.


Reply With Quote
  #14  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 07:48 PM



In comp.infosystems.www.authoring.stylesheets Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:
Quote:
kchayka wrote:
Harlan Messinger wrote:
you want column headers to be bottom-center-aligned.

.colhead { text-align: center; vertical-align: bottom; }

Better would be to use proper column header markup, with <thead> and
th> elements. Then you may not need class selectors at all.

At least not for headers.
At least not if all headers were styled one way and all the remaining
cells were styled one other way.

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Reply With Quote
  #15  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 07:59 PM



In comp.infosystems.www.authoring.stylesheets Giggle Girl <missgiggy (AT) gmail (DOT) com> wrote:
Quote:
Hello!
I am working on an app that uses dozens of tables, some with hundreds
(or even thousands!) of rows. I am interested in formatting the tables
using as much CSS as possible, so the HTML is barebones and
easy-to-read/modify. While thinking up how to do it, I came up with
this idea, which I welcome comments on:

QUESTION: What are the pros and cons of using one letter class names
for common TD cell formatting, like "nowrap" or "align=right", etc.

Something like this:

.l { text-align : left; }
.c { text-align : center; }
.r { text-align : right; }

.t { vertical-align : top; }
.m { vertical-align : middle; }
.b { vertical-align : bottom; }

.w { white-space : wrap; }
.nw { white-space : nowrap; }

This would enable you to do "shorthand" for formatting cells, like
this:

td class="c t nw">100 million</td

where this particular cell centered horizontally, middled vertically,
and with no wrapping...

What do you think?
I'm working on learning a lot of CSS right now (as opposed to having just
picked up a few tidbits in the past and not really applying them right).
My impression is that CSS is for styling purposes. It is not intended as
an HTML macro capability. You could effectively use it that way in a few
cases such as this, but that's not it's purpose.

The issue is to separate style and content. Content is what changes when
you have different data that should be shown the same way. Style is how
you want to present the content. Style would be changed if you want to
present the same content in a different way ... a different style. That
would be a guideline for what goes into HTML content and what goes into
CSS style.

All the TD cells that will always be styled the same way within a given page
should all be in the same one class. Then all the style settings for that
class would be in one CSS block for that class. The idea is to be able to
change the _style_ without changing the content. This is especially valuable
when the content is generated by software that is readily changed (e.g. a
page produced by server side scripting which could be in a compiled language
such as Java or C).

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Reply With Quote
  #16  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 08:04 PM



In comp.infosystems.www.authoring.stylesheets Alan J. Flavell <flavell (AT) physics (DOT) gla.ac.uk> wrote:
Quote:
On Fri, 28 Apr 2006, Andy Dingley <dingbat (AT) codesmiths (DOT) com> wrote:

Alan J. Flavell wrote:

Isn't it a pity that there's no way to specify that (for rows or
columns) directly in CSS?

Given the negligible support of the attribute selectors we do have,
then I doubt it would matter much whether there ought to be or not.

I handle this sort of task with XSLT. Long-winded CSS is no problem to
me, I just add it at the step before.

Oh, sure: long-winded HTML (i.e in this case with a class= on every
damned table cell) is also no problem to anyone who can write a
program to spew it out. But it's more a matter of taking a little
pride in what one extrudes out onto the world wild web - - and I'm
sure you really feel that way yourself, despite your occasional
remarks that might be interpreted to suggest otherwise :-}
I'd rather put the class on the TABLE element just once instead of having
it on each and every TD element. As I'm learning CSS right now, I think
that could work with: TABLE.myclass * TD { ... }

And if you have only one table, then why even bother with a class.

Of course if each _column_ in a multi column table needs to be styled in
a slightly different way, that gets harder. I saw some things that looked
like it could still be handled by specifying instance numbers in CSS. But
if the specific column positions could vary and need to be handled by name,
then you probably end up having to put the column name in each TD class.

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Reply With Quote
  #17  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-28-2006 , 08:09 PM



In comp.infosystems.www.authoring.stylesheets Tony <tony23 (AT) dslextreme (DOT) whatisthis.com> wrote:

Quote:
I write HTML, JavaScript & CSS as the client-side rendering, and there
are a team of developers who use what I write to make the application
work. If I can provide simple classes like .r { text-align:right; } for
them to place programatically as THEY need it, it simplifies the work
for everyone involved. And if you store that class declaration as a
constant, then all you have to do is change that single constant to
change the way the site renders.
Sounds like they need a programming toolkit to dynamically construct the
style. But I would think it should be possible to copy the default style
first, then generate the programmatically specific changed following it
(maybe within STYLE elements in the HTML so the CSS file can be the default
and remain static).


Quote:
Granted, it's not exactly what CSS is best for, but sometimes you make
the best use of the tools to accomplish a task it was never intended to
accomplish.
Sounds like you're not a programmer, and your programmers are not making
good use of abstractions in their application design.

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Reply With Quote
  #18  
Old   
Stan Brown
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-29-2006 , 04:46 AM



Fri, 28 Apr 2006 11:26:08 +0200 from Sid Ismail <elsid (AT) nospam (DOT) co.za>:
Quote:
On 27 Apr 2006 13:17:24 -0700, "Giggle Girl" <missgiggy (AT) gmail (DOT) com
wrote:

: My biggest fear is it will get expensive processor-wise.

How much do you play for each millisecond?
I'll assume you actually don't know the expression and weren't just
being snarky.

Programmers have long used the terms "cheap" and "expensive" to mean
"using little processor time" and "using much processor time". It's a
metaphor. True, it dates back to the days when many people did pay
for processor time by the minute or hour, but today it has nothing
more to do with money than the expression "beating a dead horse" has
to do with abuse of animals.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you


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

Default Re: TD CSS Shorthands... Thoughts? - 04-29-2006 , 04:52 PM



Alan J. Flavell wrote:
Quote:
On Fri, 28 Apr 2006, Tony wrote:


Another pragmatic POV:

I write HTML, JavaScript & CSS as the client-side rendering, and
there are a team of developers who use what I write to make the
application work. If I can provide simple classes like .r {
text-align:right; } for them to place programatically as THEY need
it, it simplifies the work for everyone involved.


You're showing no indication of listening. In particular to the
principle of separation of content from presentation, as designed into
the HTML/CSS design. As such, it seems that further discussion with
you would be pointless, and I'll try to keep that in mind from now on.
I am fully aware of the separation of content & presentation. However it
seems that you are not very aware of some of the practical implications
of working with a large team of coders.

Quote:
And if you store that class declaration as a constant, then all you
have to do is change that single constant to change the way the site
renders.

uh-uh, so next week you'd be happy to code stuff like:

.r { text-align: center; }

and

.blue { color: yellow; }
Seems that you're the one not listening. If the change were to be made,
it would be made on the server side, by changing a constant definition
so that it would render as class="c" or class="yellow"


Reply With Quote
  #20  
Old   
Tony
 
Posts: n/a

Default Re: TD CSS Shorthands... Thoughts? - 04-29-2006 , 04:55 PM



phil-news-nospam (AT) ipal (DOT) net wrote:
Quote:
In comp.infosystems.www.authoring.stylesheets Tony <tony23 (AT) dslextreme (DOT) whatisthis.com> wrote:

| Granted, it's not exactly what CSS is best for, but sometimes you make
| the best use of the tools to accomplish a task it was never intended to
| accomplish.

Sounds like you're not a programmer, and your programmers are not making
good use of abstractions in their application design.
Well, you're certainly entitled to your opinion.



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.