Solved

HTML Table, align image at the top of the cell

Posted on 2014-01-28
5
458 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

756 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