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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Tables move

Status
Not open for further replies.

dzisaacs

Programmer
Dec 12, 2002
53
PA
I wrote this html file which has 2 links...

1- Index
2- Contact us

I'm using the same html file for both links...i wrote the index, and did a save as, and call it contactus...i'm doing this because i'm noticing the tables move when i go from link to link eventhough they are the same file...

the first time i open it, it looks fine...however when i'm in the index and i click contact us, the table moves slightly to the left...i don't want that to happen and i have no clue of how to fix it...

Code:
<html>
<head>
<title>Tables</title>
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
}
-->
</style></head>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="572" height="600" border="1" align="center">
  <tr>
    <td width="130">&nbsp;</td>
	<td width="442">&nbsp;</td>
  </tr>
   <tr>
    <td width="130">
		<p>&nbsp;</p>
		<p>&nbsp;</p>
		<p>&nbsp;</p>
		<table width="125" border="0">
			<tr>
				<td> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="index2.htm">Index</a></td>
			</tr>
			<tr>
				<td width="60">&nbsp;</td>
			</tr>
			<tr>
				<td width="62">&nbsp;</td>
			</tr>
			<tr>
				<td> &nbsp; &nbsp; &nbsp; <a href="contactus3.htm">Contact Us</a></td>
			</tr>
	 </table>	</td>
	<td width="442"> &nbsp;
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>	  <table width="303"  border="1" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="303" height="372"><p>&nbsp;</p>
          <p>s</p>                    
		  <p>s</p>
          <p>s</p>
          <p>s</p>
          <p>&nbsp;</p>
          <p>s</p>
          <p>s</p></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

 
I replaced your html with the following and eliminated the problem (tested only in IE):
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL] 
<html>
<head>
<title>Tables</title>
<style type="text/css">
<!--
body {
    background-color: #FFFFFF;
[COLOR=blue]margin: 0;[/color]
}
-->
</style></head>
[COLOR=red]<body>[/color]....
The problem was with the margins. The doctype is just good coding practice.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thank you very much that was the solution!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top