Forum Moderators: open

Message Too Old, No Replies

HTML cell content alignment

         

stanza

1:17 am on Feb 27, 2005 (gmt 0)

10+ Year Member



I am trying to use invisible gif to expand the height of a table to make sure it is at least 300 pixels. The code looks like this:
<table>
<td><img src="invisible.gif" width=1 height=300></td>
<td>
<UL>
<LI>Hello world</LI>
<LI>Hello 2</LI>
</UL>
</td>
</table>

The result did make the table end up with 300 as height. But also is a little bit unexpected that the Hello World text ended up in the vertical middle of the table cell they are in. What I want to do is to have them appearing from the top of the table cell they are in.

Is there any trick that I can use to push the text up to the top of the cell they are in?

(What I eventually want to do was to write a php script which dynamically generate this table. It is used as a navigation panel of on the left side of a bunch of web pages. So it will be nice to have a fix size for the navigation panel, and have the navigation tree align to the top of the navigation panel.)

tedster

1:33 am on Feb 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not really a trick - this is standard mark-up.

CSS
<td style="vertical-align:top">
<UL>
<LI>Hello world</LI>
<LI>Hello 2</LI>
</UL>
</td>

or

HTML
<td valign="top">
<UL>
<LI>Hello world</LI>
<LI>Hello 2</LI>
</UL>
</td>