On Mon, Jul 28, 2008 at 9:23 PM, David Hucklesby <[EMAIL PROTECTED]> wrote:
> On Mon, 28 Jul 2008 15:02:52 -0400, Michael B Allen wrote:
>> When I generate a table, occasionally I'd like to style it in column, row 
>> and/or cell
>> specific ways. Rather than emit application specific style information on a 
>> case-by-
>> case basis, can someone recommend a method or best practices for generic 
>> table styling?
>> I'm a programmer, not a web designer. I'd like to separate my peas and 
>> carrots a little.
>>
>> For example, lets say I have a grid of products and I want to have borders 
>> only on the
>> inner cells (like a tic-tac-toe board).
>>
>> Or perhaps I want to shade every other row or only one column in a report.
>>
>> My first thought is to use multi-class attributes like:
>>
>> <td class="r12 c3 even">data</td>
>>
>> Would this work and would it be portable (e.g. do multi-class attributes 
>> work in IE 6)?
>>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Taking these in reverse order:
>
> - Would multi-class attributes work in IE 6? Well, yes and no.
>  You can certainly add more than one class to an element and have any
>   one of them recognized. But if you specify a chain of them in
>   a selector, IE 6 only applies the rule to the last one, IIRC.

You mean if the same exact selector is used IE6 does not coalesce the CSS?

This test seems to show it's working as desired with both FF3 and IE6 at least:

  http://www.ioplex.com/~miallen/table.html

If anyone sees that the first table (the real one rendered by your
browser) is different from the two graphics that follow it, please
reply indicating so if you don't mind.

> - You can apply any of four properties to a table COL, namely background,
>  width, border, and visibility. I think IE allows some more, but that's
>   not standard behavior.
>
> - For shading alternate rows, google "css striped tables" or "zebra tables."
>  Lots of solutions out there, mostly using a touch of JavaScript.
>
> - I'd classify CSS as closer to programming than designing. You should
>  get along fine once you have the hang of it.

I feel strongly about writing generic code and librarifying
components. To that end I want to emit classes that might be useful in
almost any table scenario.

Thanks for the great info.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to