Topic: Format "TD" inside "TABLE class=xxx"? (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=10872" title="Pages that link to Topic: Format &amp;quot;TD&amp;quot; inside &amp;quot;TABLE class=xxx&amp;quot;? (Page 1 of 1)" rel="nofollow" >Topic: Format &quot;TD&quot; inside &quot;TABLE class=xxx&quot;? <span class="small">(Page 1 of 1)</span>\

 
Sam
Bipolar (III) Inmate

From: Belgium
Insane since: Oct 2002

IP logged posted posted 12-10-2002 15:05 Edit Quote

Suppose I have a stylesheet which formats all my tables:

TABLE
{
font-family : Verdana;
font-size : 8pt;
}

Now I have a speciffic table type which I want to be formatted in a speciffic way so I add:

TABLE.class
{
font-family : Verdana;
font-size : 8pt;
border : 0;
width : 100%;
padding : 0;
text-align : center;
}

Problem 1
How can I format the table cells inside this last table so these cells are formatted my way and all the other cells are left unchanged?

Problem 2
How do I define the cell spacing?

Sam

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

IP logged posted posted 12-10-2002 15:55 Edit Quote

1. use

code:
.classname td{
something....
}


This will only apply to the <td>'s that are inside an element of .classname.. [edited away some stuff that turned out to not work... thanks to Slime for noticing it ]

2. check out this link

_________________________
"I don't know half of you as well as I should like; and I like less than half of you half as well as you deserve" - Bilbo Baggins (S.R 1401)

[This message has been edited by Veneficuz (edited 12-10-2002).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 12-10-2002 17:14 Edit Quote

Understand that

table.classname td

will also work.

By the way, using > isn't something you would want to do here, because TD is never a *direct* child of TABLE. There are two elements inbetween:

TABLE
TBODY
TR
TD

Sam
Bipolar (III) Inmate

From: Belgium
Insane since: Oct 2002

IP logged posted posted 12-11-2002 09:53 Edit Quote

Ok, my 1st problem is solved, thanks.

My 2nd problem isn't.
I know I can use the following inside my html page:

code:
<table cellspacing="10">


but I want to do this with a stylesheet so I put the following inside my stylesheet:

code:
table
{
border-spacing: 10px ;
}


... and this has no effect on my table!



[This message has been edited by Sam (edited 12-11-2002).]

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

IP logged posted posted 12-11-2002 11:14 Edit Quote

If there's a "border-spacing" property, it's news to me. The "margin" property will do the same thing as cellspacing used to, and "padding" will do the same thing as cellpadding. Of course, you can (and often should) apply margins or padding to other elements as well.

So your style would be something like table.classname td { padding: 10px; margin: 10px; } (add carriage returns and indentation to suit).

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

IP logged posted posted 12-11-2002 13:51 Edit Quote

Yup, no "border-spacing" property. PT is right on with the answer.



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu