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

Form within a table 1

Status
Not open for further replies.

aTekTipsUser

Programmer
Nov 8, 2004
68
US
I have the following html and it is causing a break after the </form>. How can I have a form within a table without the break after the </form>. We are using a software that requires the textboxes to be within a form inorder for the software to read the textbox. It looks fine in firefox and netscape, but in internet explorer it is causing the unwanted break.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<table width="205" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="125">
<form action="" method="post" name="test" >
<input name="test1" type="hidden" value="C10-112-001" >
<input name="test2" type="text" value="1" size="2" maxlength="2" border="0"> some.text
</form>

</tr>
</table>
</body>
</html>
 
I put in the </td> and it still has an unwanted break in internet explorer only:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<table width="205" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="125">
<form action="" method="post" name="test" >
<input name="test1" type="hidden" value="C10-112-001" >
<input name="test2" type="text" value="1" size="2" maxlength="2" border="0"> some.text
</form>
</td>
</tr>
</table>
</body>
</html>
 
For some reason, the form tag does that.

It would look much nicer if you did this:

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
   <form action="" method="post" name="test" >
  <table width="205" border="1" cellspacing="0" cellpadding="0">
   <tr>
     <td width="125">       
          
            <input name="test1" type="hidden" value="C10-112-001" >
            <input name="test2" type="text" value="1" size="2" maxlength="2" border="0"> some.text

    </td>
   </tr>
</table>
        </form>
</body>
</html>


[cheers]
Cheers!
Laura
 
That some reason why [tt]<form>[/tt] does that is because it is a block level element and it sports certain margins. I see nobody complaining that <p> tag creates breaks and it does. Anyway, through css you can easily revert that:
Code:
<form action="" method="post" name="test" [b]style="margin-bottom: 0;"[/b]>
 
or you can use "margin: 0". I do that all the time.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top