By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,624 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,624 IT Pros & Developers. It's quick & easy.

How do I apply styles to cells of styled tables?

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:
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>.
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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
"Steve Pugh" <st***@pugh.net> wrote in message
news:pd********************************@4ax.com...
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:
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.


Grand children? ;-)
.... .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
Jul 20 '05 #3

P: n/a
In article <8A******************@news-server.bigpond.net.au> in
comp.infosystems.www.authoring.stylesheets, Andrew Thompson wrote:
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/
Jul 20 '05 #4

P: n/a
"Stan Brown" <th************@fastmail.fm> wrote in message
news:MP************************@news.odyssey.net.. .
In article <8A******************@news-server.bigpond.net.au> in ....
comp.infosystems.www.authoring.stylesheets, Andrew Thompson wrote:
How do I specify a CSS rule such
that it applies to <td> & <th> tags...

... I think we just answered this.


Oops! Apologies, missed it..

A.
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.