With this CSS:
table.swtable, .swtable tr, td {border-collapse:collapse; border: 1px solid black; width: auto !important}
.swtable td {padding: 10px; text-align: center}
.swcolheading {background-color: #D9FFD9}
.swrowheading {background-color: #D9FFD9; text-align: right}
and this HTML:
<table class="swtable">
<colgroup><col class="swrowheading"></colgroup>
<tr class="swcolheading"><td></td><td>col 1</td><td>col 2</td></tr>
<tr><td>row 1</td><td>c1 r1</td><td>c2 r1</td></tr>
<tr><td>row 2</td><td>c1 r2</td><td>c2 r2</td></tr>
</table>
The table picks up the correct background colour for the first column, but the text in that column is centre aligned. How do I manage to have the text in the first column right aligned. Obviously the first line of CSS is setting the centre alignment for all cells, but how do I overwrite that for the first column?
Note, the width option is specified for the table, because someone else's CSS had set a table width of 100% which I did not want.