Topic: First TD (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11006" title="Pages that link to Topic: First TD (Page 1 of 1)" rel="nofollow" >Topic: First TD <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 07-11-2003 18:03

Hello,
I'm trying to set the font-weight for the first TD of a particular table who's class is "some_class"... but am not getting it to work. Here is what I have:

.contact_detail td:first-child{
font-weight:bold;
}

Am I close?
Karl

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 07-11-2003 18:38

From what I've read in the specs, yes, that seems correct.

I've also read though that support for 'first-child' is still pretty quirky...may want to check out som compatibility charts.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 07-11-2003 19:27

It's very likely that you're just encountering a browser bug.

However, you should ask yourself, why are you making these particular table cells bold? I suspect that you want them to look like they're the header for the row they're on. Consider, if these table cells are headers, perhaps you should be using the <th> (table header cell) tag instead of the <td> (table data cell) tag? If that's the case, then you can merely start using <th> instead of <td> in those places, and apply the styles you want to <th> tags. Then you don't have to worry about the first-child problem.

Only do that, though, if the cells you're making bold are indeed header cells.

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 07-11-2003 20:19

My result will contain 5 to 10 columns (TD's).. I have multiple rows of these results, so like 100. The first TD of each result I'd like to set to BOLD. I am generating my results with XSLT, I could easily generate a class for the first TD... but was trying to accomplish with CSS. Will probably just handle this with XSLT.

Karl

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 07-11-2003 20:36

We understand what you want, but slime's question of why is a good one - I'm curious...

Are they going to act as headers, or is there some other reason?

ozphactor
Maniac (V) Inmate

From: California
Insane since: Jul 2003

posted posted 07-11-2003 20:54

Hmm... the ":first-child" pseudo-class isn't supported by most browsers (although I wouldn't be surprised if it happened to work in Opera or Mozilla) so you don't wanna rely on that one. Better just to give them class attributes, even if that dirties up the code a little.

Of course, if they're header cells you should be using <th> as slime said.
<th> automatically boldens the text within it.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu