This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > December 2003 > How do I apply styles to cells of styled tables?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How do I apply styles to cells of styled tables?
Andrew Thompson

2003-12-15, 4:35 pm

How do I specify a CSS rule such
that it applies to <td> & <th> tags
that are contained within (are children
of? ..is that the correct term) a <table>
who's style is class="element"?

Vis.
<table class="element">
<tr>
<td>This with a style</td>
</tr>
</table>

<table>
<tr>
<td>But not this</td>
</tr>
</table>

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


Steve Pugh

2003-12-15, 4:35 pm

"Andrew Thompson" <andrew64@bigNOSPAMpond.com> wrote:
quote:

>How do I specify a CSS rule such
>that it applies to <td> & <th> tags
>that are contained within (are children
>of? ..is that the correct term)



Descendents. Children are descendents who are just one level down.

<div>
<ul>
<li></li>
</ul>
</div>

The <ul> is a child of the <div>. The <li> is a child of the <ul>.
The <li> is a descendent of the <div> but is not a child of the <div>.
quote:

>a <table> who's style is class="element"?
>
>Vis.
><table class="element">
> <tr>
> <td>This with a style</td>
> </tr>
></table>
>
><table>
> <tr>
> <td>But not this</td>
> </tr>
></table>



..element td, .element th {styles for th and td that are descendents of
class="element"}

A space is the descendent selector.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
Andrew Thompson

2003-12-15, 4:35 pm

"Steve Pugh" <steve@pugh.net> wrote in message
news:pd7ptv4u0aqjvtq8jr96jmc7aft94ke5it@4ax.com...
quote:

> "Andrew Thompson" <andrew64@bigNOSPAMpond.com> wrote:
>
>
> Descendents. Children are descendents who are just one level down.



Grand children? ;-)
....
quote:

> .element td, .element th {styles for th and td that are descendents of
> class="element"}
>
> A space is the descendent selector.



Thank you kindly, Steve.

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


Stan Brown

2003-12-15, 4:35 pm

In article <8A0Db.52640$aT.18086@news-server.bigpond.net.au> in
comp.infosystems.www.authoring.stylesheets, Andrew Thompson wrote:
quote:

>How do I specify a CSS rule such
>that it applies to <td> & <th> tags
>that are contained within (are children
>of? ..is that the correct term) a <table>
>who's style is class="element"?



I think we just answered this.

table th, table td { /* general properties */ }

table.element th, table.element td { /* exception properties */ }

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Andrew Thompson

2003-12-15, 4:35 pm

"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.1a46f7175bc88cec98b96d@news.odyssey.net...
quote:

> In article <8A0Db.52640$aT.18086@news-server.bigpond.net.au> in


....
comp.infosystems.www.authoring.stylesheets, Andrew Thompson wrote:
quote:

...[QUOTE][color=darkred]
> I think we just answered this.



Oops! Apologies, missed it..

A.


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews