HTML/CSS table right align text not working in IE

Viewed 17118

Again, Internet Explorer is not getting easy on me. I have a table with two cells in the same row. I want to display some text aligned to the left (first cell), and another one aligned to the right (second cell). This is working fully in Chrome and Firefox, but in IE all the text appears left-aligned:

<table width="660px">
<tr>
    <td align="left" width="160px">Text 1</td>
    <td align="right" width="160px">Text 2</td>
</tr>

​​​​​​​​​​​​​

After some research I wondered if I should put it on the CSS, so I changed it to:

HTML:

<table class="anchors" width="660px">
<tr>
    <td class="left" width="160px">Text 1</td>
    <td class="right" width="160px">Text 2</td>
</tr>

CSS:

table.anchors td.left
{
    text-align: left;
}

table.anchors td.right
{
      text-align: right;
}

It still doesn't work in IE (version 9, at least). Does anybody has a hint on this? Should I be using something else (a div, e. g.)?

3 Answers
Related