Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Form | 1 | Q1212 [ previous next ]

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?'

©2018 Martin Webb