Link to home
Start Free TrialLog in
Avatar of Mark
Mark

asked on

form tag adds blank line in IE

I have two tables on a page. Between the two tables I define a <form>. On IE it inserts a blank line when I define a form. On firefox and safari it does not. Is there any way to make IE not do this? Short of that, can I tell (in jsp) what kind of browser has connected?
<html>
<body>
<table cellspacing=0 border=1 bordercolor=red><tr><td>table1</td></tr></table>
<form name=joe method=post>
<input type=hidden value=joe>
<table cellspacing=0 border=1 bordercolor=blue><tr><td>table2</td></tr></table>
</form>
</body>
</html>

Open in new window

Avatar of erikTsomik
erikTsomik
Flag of United States of America image

try this
<html>
<head></head>
<body>
<table cellspacing="0" border="1" bordercolor="red"><tr><td>table1</td></tr></table>
<form name=joe method=post>
<input type=hidden value=joe>
</form>
<table cellspacing="0" border="1" bordercolor="blue"><tr><td>table2</td></tr></table>

</body>
</html>
Let me know if this fix the problem?
the form itself add blank . So you can put higher or lower of your code
like this
<html>
<head></head>
<body>
<table cellspacing="0" border="1" bordercolor="red"><tr><td>table1</td></tr></table>
<table cellspacing="0" border="1" bordercolor="blue"><tr><td>table2</td></tr></table>
<form name=joe method=post>
<input type=hidden value=joe>
</form>

</body>
</html>
that is correct you can use the one form for all you postback validations. if you surround the input type within the form tag no matter where is it on the page. It will still return.

Not a form with runat server is a whole different method.

<form name=joe method=post ID="Form1">
<table cellspacing=0 border=1 bordercolor=red ID="Table2"><tr><td>table1</td></tr></table>
 
<input type=hidden value=joe ID="Hidden1" NAME="Hidden1">
<table cellspacing=0 border=1 bordercolor=blue ID="Table3"><tr><td>table2</td></tr></table>
</form>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of itzy
itzy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark
Mark

ASKER

Moving the tables to either side of the form isn't practical since the real table contains form elements. I probably should have shown that in my example.

setting the margins to zero did the trick. In my case, setting the bottom margin didn't work, but setting the top margin did. So, I just created a class for form in the global css file with margin: 0. That *should* be I.E. default like it obviously is in safari

Thanks!