SunnyByfleet
Technical User
Here's a simple code snippet:
I would expect on running that, that L Yada would be left aligned, having picked up its style from class2, whereas R Yada would be right aligned, having picked up its style from class1.
However, when I run it, everything is right aligned.
I must be missing something fundamental here, but I can't see what it is.
Basically, I want to have a general style, in class1, but have extra bits where necessary for individual cells.
Any ideas?
Code:
<style>
.class1 td
{
text-align: right;
}
.class2
{
text-align: left;
}
</style>
<div class = "class1">
<table border = "1">
<tr>
<td>Yada yada yada</td>
<td>Yada yada yada</td>
</tr>
<tr>
<td class = "class2">L Yada</td>
<td>R Yada</td>
</tr>
</table></div>
I would expect on running that, that L Yada would be left aligned, having picked up its style from class2, whereas R Yada would be right aligned, having picked up its style from class1.
However, when I run it, everything is right aligned.
I must be missing something fundamental here, but I can't see what it is.
Basically, I want to have a general style, in class1, but have extra bits where necessary for individual cells.
Any ideas?