Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aligning in tables

Status
Not open for further replies.

EdFredenburgh

Instructor
Apr 30, 2002
62
GB
Apologies for my very basic queries. I have a simple table on my DW index page (with background colour on the page). Tried to insert a Photoshop jpeg (logo) with a matching background, in a cell and align it at the top of the cell. No dice: it stays centred vertically whatever I do – and the code says it's top aligned. Not what I call user-friendly. Any ideas, please? Before I'm sacked for missing completion dates...
 
Can you paste your actual code, we can help you more if we can actually see what your code is.

<td valign="top">

Is how to make the cell align to the top.

Dodge20
 
Thanks Dodge. Tried valign, still didn't work. Here's entire code (sorry!) in case there's some CSS conflict I haven't recognised (seems to be a lot of unnecessary code...):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Living River - home</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="../CSS/Palatino%20text.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
background-color: #CCFFFF;
}
-->
</style></head>

<body>
<table width="800" height="1100" border="0" align="center" cellpadding="0" cellspacing="0" id="LR general">
<tr>
<th width="144" rowspan="2" scope="col">&nbsp;</th>
<th width="204" height="100" scope="col">&nbsp;</th>
</tr>
<tr>
<td width="656" height="500"><img src="../images/LRds-blue.jpg" width="227" height="100" align="top" td valign="top" /></td>
</tr>
<tr>
<th scope="col">&nbsp;</th>
<td height="500">&nbsp;</td>
</tr>
</table>

</body>
</html>
 
clik to the right of the image (in the cell) and then use that cell's alligment

<td width="656" height="500" valign="top"><img src="../images/LRds-blue.jpg" width="227" height="100" align="top" td valign="top" /></td>

:--------------------------------------:
fugitive.gif

[URL unfurl="true"]http://mostarnet.com[/url]

All around in my home town,
They tryin' to track me down...
 
Change

Code:
<td width="656" height="500"><img src="../images/LRds-blue.jpg" width="227" height="100" align="top" td valign="top" /></td>

to

Code:
<td valign="top" width="656" height="500"><img src="../images/LRds-blue.jpg" width="227" height="100" align="top"></td>

The valign should be in the original <td> tag not in the picture attributes.

Dodge20
 
Thanks a lot, all. Got it working. Sure I'll be back with more basic panics soon! Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top