Click to See Complete Forum and Search --> : Bold Table Text (CSS)


Dysan
12-26-2007, 09:02 PM
Hi,

I have the following code, can creates a simple 1 column by 2 row table.
How do I display "Persons First Name" in bold, without displaying "Persons Last Name" in bold?

e.g.

Persons First Name
Persons Last Name

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>

</head>

<body>
<table width="246" border="1" class="coll">
<tr>
<th width="135">Name</th>
<th width="95">&nbsp;</th>
</tr>
<tr>
<td id="bold">Persons First Name<br>
Persons Last Name </td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

Jick
12-26-2007, 09:07 PM
I could be missing the point but shouldn't just this work:<td id="bold"><b>Persons First Name</b><br>
Persons Last Name </td>Or if you want CSS you could do:<td id="bold"><span style="font-weight: bold;">Persons First Name</span><br>
Persons Last Name </td>Does that help?

Major Payne
12-27-2007, 04:39 PM
Then you could probably get rid of the id="bold" selector if that's all it was doing.

Ron

WebJoel
12-27-2007, 06:26 PM
I think that the psuedo-class " :first-word {} " is a proposal for CSS3.

Currently all I know of, if " :first-letter {} ", like this:
CSS:<style>
td {border:2px solid red; padding:4px 6px;}
td:first-letter {font-style:italic; font-weight:bolder; padding:2px;}
</style>HTML<table>
<tr>
<td>Firstname, LastName Jr.</td><td>FirstName, W. LastName Sr.</td>
</tr>
</table>

ray326
12-27-2007, 09:34 PM
It probably shouldn't be a table in the first place. It certainly doesn't need an empty column if it IS a table.

WebJoel
12-28-2007, 08:21 AM
I was rather hoping that this was a tabular listing of names, broken down into multiple instances of "first-name/last-name", in which case something involving "<TH>" could be used. Then perhaps, make the children of the TH "first-name" all be "font-weight:bold;" and the children of TH "last-name" be font-weight:normal;", but I'm not sure if decendant TD's of TH 'inherit' from parent..

This would be easier with DIVs though, eh?

ray326
12-28-2007, 10:08 AM
I think I'd use a DL for what the OP shows.