Forum Moderators: open
"user" is spanning two rows in a table (look to left).
"date" is only spanning 1 (look up and right):
<tr>
<td rowspan=2> user </td>
<td> new </td> <td> date </td>
</tr>
<tr>
<td colspan=2> message </td>
</tr>
How can I get that "date" line to use only the height required for the text? Opera restricts it that way, but ie doesn't under certain conditions. When "message" isn't large enough to force IE to expand the height of that td, then it splits the space left over with "date".
You can't set a size that will override the computed value if that size will be below the computed value. You can only set a size that is larger than the computed value.
So, you could try setting the height property of the "message" cell to more than what it's computed value would be, and this would reduce the size of those cells above it. However, you can't set it as a percentage, so the hack of setting the cell to height: 100% won't work. You can only set it as a real value -- which has obvious disadvantages.
If someone has a hack for this, I'm all ears. I've run into this problem before myself, but it defeated me. :(
The width that IE allocates for a text line is actually just a bit wider than the visible text seems to need. When the available width of a cell is too close to the end of the text, then IE also grabs a new line in the table cell. This increases the cell height for no obvious reason, because there is no visible content on the new line.
What's going on is the browser is making space to wrap to a new line - even though not one letter is actually going to wrap. This is what increases the browser's cell height calculation.
The way I avoided this unwanted effect was to increase the cell WIDTH, rather than trying to limit or control the cell height. By making sure the cell was just a bit wider than the text seemed to require, the browser didn't calculate the need for a line wrap when one wasn't actually called for.
In that situation, IE divvies up the total height by a proportional rule. If both cells have one line, they each get half the available height, etc. When you get enough lines into the message cell, then the date cell is pushed up to use just the minimum height needed for one line of text.
If you set a height attribute in the message cell (I used height=120 in my test) it guarantees at least that much height for the message cell, and then everything seems to work just fine.
[edited by: tedster at 2:09 am (utc) on June 3, 2002]
colspan="3" in the "title" cell should be colspan="2", and colspan="2" in the new/date and message cells should be removed.
Comme ca:
<tr>
<td colspan=2> title </td>
</tr>
<tr>
<td rowspan=2> user </td>
<td> new icon ---- date </td>
</tr>
<tr>
<td> message </td>
</tr>
For now, most of the forum validates (I have been to the mountain) and so far looks good in all browsers I've thrown it at. I'm going to take hands off the message displays for awhile.