Forum Moderators: open

Message Too Old, No Replies

<Form> Tags and Netscape

Why is there a blank line??

         

txbakers

4:42 am on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've noticed that in Netscape a blank line is inserted near the </form> tag. When I move the form around, the blank line moves around as well.

What's up with this? And How can I avoid it???

Thanks.

txbakers

4:50 am on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My own question answered.

If the form is just under the table tag, it leaves a blank line. When I put the form tag just before an inner table, it hides the line.

I also suspect that my form tags weren't aligned and IE just ignored it.

It would be nice if there was a "delete post" button for when I post a question that I shouldn't have......

justa

4:58 am on Dec 12, 2001 (gmt 0)

10+ Year Member



It's always good to see answers to other questions posted, even if you do it yourself.

I might never run into the problem, but then again it might crop up tomorrow. At least there will be an answer somewhere.

IanKelley

6:20 am on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Another way to get around the break before and after forms is to use CSS to set the top and bottom margins to 0px

seriesint

7:28 am on Dec 12, 2001 (gmt 0)



I'm usually after the compact side of the equation and have the form inside a div with a css tag of display:inline; for the form. Guess it's cause I'm too lazy to type padding: 0; margin: 0; :)

joshie76

9:27 am on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're not nesting tables and want to avoid the extra line problem you can put the form tags between the TR and TABLE tags as so...

<table>
<form>
<tr>
... table cells contaning form ...
</tr>
</form>
</table>

This avoids using any CSS at all.

Xoc

10:52 am on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think that validates.

netcommr

2:55 pm on Dec 12, 2001 (gmt 0)

10+ Year Member




XOC, your right, but it works.

I tend to go this route though.

<table><tr>
<td width=1><form></td>
<td width="100%">content</td>
<td width=1></form></td>
</tr></table>

-------------
IE puts a line break at the beginning of the form and NS puts one at the end. Do ya think they worked together to mess with heads??
-------------

IanKelley, watch your usage of 'margin-bottom', many browsers have trouble with it. (Opera,pre-NS6)

joshie76

3:58 pm on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Xoc, do you think of anything else?

I imagine you panicking and flapping your hands in disgust at the sight of non-validating code; like Drew Barrymore in ET:). No offence, it's good that someone's fighting the corner for a better web.

You are of course correct, but it works in every browser I've tried (whereas a lot of the CSS fixes don't).

tedster

4:17 pm on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> non-validating code...You are of course correct, but it works in every browser I've tried

The big deal for me about validating code is that search engine spiders are a kind of browser -- and we can't test for them!

Marshall

4:37 pm on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can use:
<table>
<tr>
<td>
<form>
<table>
<tr>
<td>
Form Information
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>

This prevents the space and it validates.

txbakers

6:13 pm on Dec 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The best way I've discovered to deal with the line was to put the form within the <td> tag, however, in order to set up multiple tables within a form, that becomes tricky.

<table>
<tr><td>
<form>
<table>
<tr><td></td></tr>
</table>
<table>
<tr><td></td></tr>
</table>
</form>
</td></tr>
</table>

This allows the user to enter one column of the form with a tab downward instead of across.

it's a nicety.

Brett_Tabke

10:57 am on Dec 17, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Joshie, tedster has the answer there with spiders and validating code. There is also the old issue that many browsers will have a difficult time with non-validating table code. The age-old Netscape 4 disappearing content syndrome comes to mind (just one missed close tag on a table can leave your page invisible under netscape 4).

That all said, did you know that closing tags </tr>'s are actually optional?

HTML 3.2:

The TR or table row element requires a start tag, but the
end tag can always be left out.

Xoc

10:38 pm on Dec 17, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I wouldn't risk leaving off </tr>. I'll bet it breaks half the web spiders and most of the more obscure web browsers. Just because it's in the spec doesn't mean that the spider conforms.

txbakers

10:59 pm on Dec 17, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After my debacle with Netscape I wouldn't recommend leaving off any tags for any reason, and be sure that all your spaces are accounted for.

I noticed also that in Netscape this is valid:
<img width="100"> but this is not:
<img width = " 100 "> Those extra spaces aren't appreciated.......