Solved

HTML Table, align image at the top of the cell

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

785 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