But Sebastian Rose's request that prompted it, /could/ equally well
be addressed with the "align" attribute:
How about this (line-wrapped for readability):
<tr>
<td class="right">1</td>
<td class="left">bar</td>
<td class="left">text</td>
<tr>
instead of
<tr>
<td style="text-align:right">1</td>
<td style="text-align:left">bar</td>
<td style="text-align:left">text</td>
<tr>
??
Combined with the ways to add IDs and classes to tables, we could
then style the
columns better.
I would like to set this for right aligned <td> tags as default:
td.right { font-family:monospace;text-align:right; }
Using the "align" attribute as follows,
<tr>
<td align="right">1</td>
<td align="left">bar</td>
<td align="left">text</td>
<tr>
Sebastian could achieve the same with CSS like
td[align="right"] { font-family: monospace;}
In the same way one could even use CSS to override the alignment
specified by the "align" attribute, if for whatever reason this
seemed like a good idea...
One slight advantage of the "align" attribute over "class" is that
it doesn't require the default style to contain the extra verbiage
Carsten mentioned:
I have now in the default style:
td, th { vertical-align: top; }
th.right { text-align:right; }
th.left { text-align:left; }
th.center { text-align:center; }
td.right { text-align:right; }
td.left { text-align:left; }
td.center { text-align:center; }
Is there a way to write this more compactly?
Yours,
Christian