You can use :first-child to target cells in the first column:
td { text align: left; } td:first-child { text-align: right; }
But :first-child : does not work in IE 6 , so you may need to add a class to the cells in the first column and use this instead:
<table> <tr><td class="first">Previous:</td><td>Link 1</td></tr> <tr><td class="first">Next:</td><td>Link 2</td></tr> </table> td { text align: left; } td.first { text-align: right; }
As written, this applies to all <td> elements, so you can also add a class to your table and restrict the <td> styles in this table:
<table class="simple"> <tr><td class="first">Previous:</td><td>Link 1</td></tr> <tr><td class="first">Next:</td><td>Link 2</td></tr> </table> table.simple td { text align: left; } table.simple td.first { text-align: right; }
source share