PDA

View Full Version : text won't align at top of table


JoeBurns
04-22-2007, 05:13 PM
I've got text in a table that won't align at the top:

<td height="79"valign="top"><table width="150" border="0" cellpadding="0" cellspacing="0" class="Side_Links">

It looks fine in Dreamweaver, but displays verticaly in the center of the table. I've been woking in Dreamweaver for years and never had this problem. I tried fixing it w/ css:

vertical-align: top;

This didn't work either.

Page:

http://www.capitalinternet.com/~mycredit/template.php

Thanks!

Andromeda
04-22-2007, 07:47 PM
shouldn't the table tag come before the td tag?

JoeBurns
04-22-2007, 07:53 PM
I don't know -- should it?

Andromeda
04-22-2007, 08:06 PM
Try swapping it around so the code looks like this:

<table width="150" border="0" cellpadding="0" cellspacing="0" class="Side_Links">
<td height="79" valign="top">
</td></table>

JoeBurns
04-22-2007, 08:24 PM
That doesn't seem to work either.

chriskq
04-23-2007, 12:03 AM
rather table-noob-esque

v-align top is only valid in html 4.0 so if u are using xhtml doc type that will be invalid.

use this:

<style type="text/css">
table.Side_Links tr td p{
vertical-align: top;
line-height: 1em;
margin: 0;
padding: 0;
}
</style>
<table width="150" border="0" cellpadding="0" cellspacing="0" class="Side_Links">
<tr>
<td>
<p>text here.</p>
</td>
</tr>
</table>

domedia
04-23-2007, 12:38 PM
You could actually take all the table attributes and convert to CSS.