Forum Moderators: not2easy
.mytable TD { text-align:center;}
.left {text-align:center;}
.left TD {text-align:center;}
<TABLE class=mytable><TR>
<TD class=left>Boo boo puppy</TD>
<TD>Blah blah blah></TD>
</TR></TABLE>
I tried one or the other of the .left definitions, but neither one works. Any ideas? Thanks a bunch...
[b]
[pre]<HTML><HEAD><STYLE type="text/css">
.mytable TD { text-align:center;}
.left {text-align:left;}
.left TD {text-align:left;}
</STYLE></HEAD><BODY>
<TABLE class=mytable border=1 width=300><TR>
<TD>Boo boo puppy</TD>
<TD class=left>Blah blah blah</TD>
</TR></TABLE></BODY></HTML>[/b][/pre]
.left TD {text-align:left;}
you are instructing the browser to left-align any td elements inside an element in the "left" class.
Second, the specificity of the first rule is giving it precedence over the second -- see [w3.org...] for the standard.
Try
.mytable td {text-align:center;}
td.left {text-align:left;}
or depending on what you are trying to do,
.mytable td {text-align:center;}
.mytable .left {text-align:left;}