In a table cell that has vertical alignment: at the bottom, I have one or two divs. Each div floats to the right.
Presumably, divs should not match the bottom, but they do (which I don't understand, but that's good).
However, when I have two floating divs in a cell, they are aligned to the same top row. I want the first, smaller, div to sit all the way down. Another acceptable solution is to create the full height of the table cell.
It's hard to explain, so here is the code:
<style type="text/css"> table { border-collapse: collapse; } td { border:1px solid black; vertical-align:bottom; } .h { float:right; background: #FFFFCC; } .ha { float:right; background: #FFCCFF; } </style> <table> <tr> <td> <div class="ha">@</div> <div class="h">Title Text<br />Line 2</div> </td> <td> <div class="ha">@</div> <div class="h">Title Text<br />Line 2<br />Line 3</div> </td> <td> <div class="h">Title Text<br />Line 2</div> </td> <td> <div class="h">Title Text<br />Line 2</div> </td> <td> <div class="h">Title Text<br />Line 2</div> </td> </tr> <tr> <td> <div class="d">123456789</div> </td> <td> <div class="d">123456789</div> </td> <td> <div class="d">123456789</div> </td> <td> <div class="d">123456789</div> </td> <td> <div class="d">123456789</div> </td> </tr> </table>
Here are the problems:
- Why is the @ sign at the same level as the yellow div?
- Presumably vertical alignment does not apply to block elements (for example, to a floating div) 1. But it does!
- How can I make @ sit down or make it the full height of the table cell?
I am testing in IE7 and FF2. Target support is IE6 / 7, FF2 / 3.
Clarification: The goal is to have red @ in the bottom row of the table cell, next to the yellow box. Using clear on any div, they will be placed on different lines. In addition, cells can have variable lines of text, so row height will not help.
css
Tom ritter
source share