Solved

HTML Table, align image at the top of the cell

Posted on 2014-01-28
5
437 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in script 11 47
Form Submit falis 6 26
Change javascript css 1 20
execute script based on HTML event 6 0
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

867 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

26 Experts available now in Live!

Get 1:1 Help Now