Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1212 How can I stop the end of form tag </FORM> creating a blank space after the form?

irt.org | Knowledge Base | JavaScript | Form 1 | Q1212 [ previous next ]

Q1212 How can I stop the end of form tag </FORM> creating a blank space after the form?

First, don't omit the end form tag! Browsers may not render your form!

Place the </form> tag outside of a </td> tag and before the next <td> or </tr> or </table> tag.

There is a logical explantion for all of this:

</form> produces a line feed. The following HTML:

<form>Hello</form>World

results in:

Hello

World

Whereas the following HTML:

a
<table border="1">
b
<tr>
c
<td>
d
</td>
e
</tr>
f
</table>
g

Results in:

a b c e f 
+-+
|d| 
+-+
g

In other words: items of text and/or HTML found between table cells are rendered before the table. This means that the line break caused by </form> is place before the table.

The above maybe not be valid HTML, it may not always work on all browsers - but it does what you require.

Sean McCafferty replies:

You can suggest suppression of that margin in a style sheet, e.g.
<style type="text/css"><!--
form {margin-bottom : 0; }
//--></style>

Feedback on 'Q1212 How can I stop the end of form tag </FORM> creating a blank space after the form?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.