Solved

HTML Table, align image at the top of the cell

Posted on 2014-01-28
5
430 Views
Last Modified: 2014-01-28
Dear Experts,
I want to align an image at the top of a table cell, the following code does not align the image at the top of the table cell:
The image is still vertically centred, but I want to have it at the TOP of the cell


<table width="658" border="0">
  <tr>
    <td colspan="3"><strong>Projektmanagement</strong></td>
    <td width="18">&nbsp;</td>
    <td colspan="3"><strong>Systemmigration</strong></td>
  </tr>
  <tr>
    <td width="64" ><img src="SomeImage_Resolution65x67.png" style="vertical-align: top" /></td>
    <td width="12">&nbsp;</td>
    <td width="252">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vel<br />
libero mattis nisi ultricies accumsan sed eu urna. Nunc fermentum<br />
luctus iaculis. Sed arcu nunc, egestas eget hendrerit quis, placerat a<br />
metus. Donec euismod ullamcorper turpis in laoreet.</td>
    <td>&nbsp;</td>
    <td width="64"><img src="SomeImage_Resolution65x67.png" style="vertical-align: top" /></td>
    <td width="12">&nbsp;</td>
    <td width="252">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vel<br />
libero mattis nisi ultricies accumsan sed eu urna. Nunc fermentum<br />
luctus iaculis. Sed arcu nunc, egestas eget hendrerit quis, placerat a<br />
metus. Donec euismod ullamcorper turpis in laoreet.</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
</table>


Many thanks for your support
0
Comment
Question by:mruff
  • 2
  • 2
5 Comments
 
LVL 26

Expert Comment

by:pony10us
ID: 39815324
Have you tried:

<td width="64" valign="top" ><img src="SomeImage_Resolution65x67.png" style="vertical-align: top" /></td>

Open in new window


Notice the valign="top"

EDIT:  If using HTML5 this probably won't work and you should use CSS instead.
0
 
LVL 4

Accepted Solution

by:
ravikantninave earned 500 total points
ID: 39815734
This works fine :

<td width="64" valign="top" ><img src="yourimage.png" /></td>

Open in new window

0
 

Author Closing Comment

by:mruff
ID: 39815805
Perfect - thank you!
0
 

Author Comment

by:mruff
ID: 39815815
@admin, sorry, just noticed now, that I got answers from two different experts, can you please split the 500 points between  pony10us and ravikantninave, thank you
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39815817
mruff & admin,  Don't worry about it.  I see that I had a mistake in mine.

Thanks ravikantninave, I didn't read the whole line and left the "style=" part in. My mistake.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now