Forum Moderators: not2easy

Message Too Old, No Replies

td styling

         

almo136

2:52 pm on Mar 14, 2009 (gmt 0)

10+ Year Member



Hi,

I'm trying to style a td using css but no success so far, this is the code:

#details td {
background-color: #8dbdd8;
}

$toreplacedetails .= "<div id='details'><table>";
$toreplacedetails .= "<tr><th colspan=2></th></tr>";
$toreplacedetails .= "<tr><td>User</td><td> " . $_SESSION['valid_user'] . "</td></tr>";
$toreplacedetails .= "<tr><td>List Description </td><td>" . substr($list_description,0,400) . "</td></tr>";
$toreplacedetails .= "<tr><td>No. of songs </td><td>" . $songcount . "</td></tr>";
$toreplacedetails .= "<tr><td>Total songs size </td><td>" . round((float)$songstotsize/1073741824,3) . " GB </td></tr>";

$toreplacedetails .= "</table></div>";

Anyone know how to get this working?

Thanks!

rocknbil

5:22 pm on Mar 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Either

#details table td {
background-color: #8dbdd8;
}

or remove the div (better)

$toreplacedetails .= "<table id='details'>";
....
$toreplacedetails .= "</table>";

swa66

6:47 pm on Mar 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aside of specificity problems (but that would need other CCS overriding your settings), I fail to see a reason why "#details table td" should work when "#details td" does not.

Of course the "frivolous" use of divs should be avoided when there is an element that can perform the function equally well, if not far better.

I'd make sure the generated html and CSS are valid.