tags:

views:

39

answers:

2

Hi all,

This little issue is starting to do my head in, I have read around a lot and have never had an issue with this in the past but I cannot seem to get the second div to appear on the right side of the table cell, any help would be appreciated.

My Markup is

<td>
    <div class="sort">
        <a href="#">ID</a>
        <span class="icon1"></span>
    </div>
    <div class="divider icon2"></div>
</td>

And my css is

thead .sort a {
    color: #fff;
    float: left;
}

thead .sort {
    float: left;
}  

thead .divider {
    float: right;
}  

I am expecting this is something simple or something I am just overlooking.

Thanks,

A: 

you are using <thead> in your CSS and yet in the Html, you are using <td>. Try use <thead> in your Html

J Angwenyi
I have thead, it goes <table><thead><tr><td> etc
Martin
I think your CSS then needs modifications, replace thead with div. Just thinking
J Angwenyi
A: 

table .sort a {color: #f00; float: left;} table .sort {float: left; border:1px solid #093;}
table .divider {float: right; border:1px solid #00F;}

and

<table width="100%" border="0">
      <tr>
        <td>
          <div class="sort">
            <a href="#">ID</a>
            <span class="icon1"></span>
          </div>
          <div class="divider icon2">icon</div>
        </td>
      </tr>
    </table>

works.

Note I just added a couple of borders to the CSS.

But then I just tried your code and that works here too.

Using THEAD or TABLE in the CSS seems to make no difference. Is it possible you have another style clashing with those used for the table?

Anyway, with the above CSS (referencing table .SORT instead of THEAD .sort), adding THEAD tags around a row in the HTML doesn't affect it.

Hope that helps.

David
Thanks David, that has helped, I have taken out all my CSS apart for the ones that could effect this and have found the problem, I was adding a bit of padding to the right side of the cell, this cell is so small the padding was pushing the icon up against the title. Thanks for your help.
Martin
Cool, glad you found the prob, and happy to have helped :)
David