Question on (X)HTML/CSS table structures

J

Jeremy Brown

Hi,
I have several tables on my site that have the same layout throughout the
site, regardless of page. I am inherently lazy and do not want to type a
class="xxxx" in every row <tr> and data <td> entry of a table. I am
wondering if there is a way to put a single class in the <table> that will
configure the whole table, <td> & <tr> included if possible.

Thanks,
Jeremy

Example of what I am talking about:
http://jerem43.home.att.net/home for an example of the type of table I am
talking about, specifically the "Jumpstation"

http://jerem43.home.att.net/css for my style sheet
 
T

Toby Inkster

Jeremy said:
I am inherently lazy and do not want to type a class="xxxx" in every
row <tr> and data <td> entry of a table.

TABLE.foo { color:blue; border:1px solid green; }
TABLE.foo TD { color:blue; border:1px solid red; }

<table class="foo">
<tr><td>a</td><td>b</td></tr>
<tr><td>1</td><td>2</td></tr>
</table>

Go read up on descendant selectors.
 
S

sorry.no.email

Hi,
I have several tables on my site that have the same layout throughout the
site, regardless of page. I am inherently lazy and do not want to type a
class="xxxx" in every row <tr> and data <td> entry of a table. I am
wondering if there is a way to put a single class in the <table> that will
configure the whole table, <td> & <tr> included if possible.

Thanks,
Jeremy

Example of what I am talking about:
http://jerem43.home.att.net/home for an example of the type of table I am
talking about, specifically the "Jumpstation"

http://jerem43.home.att.net/css for my style sheet

Hi Jeremy,

There are some bizarre examples on the CSS Table Gallery but also a
few very nice ones:

http://icant.co.uk/csstablegallery/

I modified one myself (Like Adwords):

http://www.pnc.com.au/~plstrong/strongs/appendices_2.html

Hope this helps,

Andrew.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,538
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top