How to remove the spacing between <form> tag?

Discussion in 'HTML' started by kaiwing18@gmail.com, Oct 17, 2007.

  1. Guest

    Hello all,

    I have the following simple html how can I display the second table
    content like the first one. As i have add the <form>payment</form>
    tag. Any method to remove the spacing.


    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>[history | payment]</td>
    </tr>
    </table>

    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>[history | <form>payment</form>]</td>
    </tr>
    </table>

    Thx,

    Wing
     
    , Oct 17, 2007
    #1
    1. Advertising

  2. Chaddy2222 Guest

    wrote:
    > Hello all,
    >
    > I have the following simple html how can I display the second table
    > content like the first one. As i have add the <form>payment</form>
    > tag. Any method to remove the spacing.
    >
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | payment]</td>
    > </tr>
    > </table>
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    >

    Learn some better coding from:
    http://www.htmldog.com
    --
    Regards Chad. http://freewebdesign.awardspace.biz
     
    Chaddy2222, Oct 17, 2007
    #2
    1. Advertising

  3. Neredbojias Guest

    Well bust mah britches and call me cheeky, on Wed, 17 Oct 2007 13:09:32 GMT
    scribed:

    > Hello all,
    >
    > I have the following simple html how can I display the second table
    > content like the first one. As i have add the <form>payment</form>
    > tag. Any method to remove the spacing.
    >
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | payment]</td>
    > </tr>
    > </table>
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | <form>payment</form>]</td>
    > </tr>
    > </table>
    >
    > Thx,
    >
    > Wing


    Set margins and padding to 0 on the form. If the line feeds are a problem,
    it _may_ be possible to render the form as inline (display:inline;).

    --
    Neredbojias
    Half lies are worth twice as much as whole lies.
     
    Neredbojias, Oct 17, 2007
    #3
  4. Guest

    This is a quck fix though it would be better to have all your style
    sheet code in a seperate css file
    change
    <td>[history | <form>payment</form>]</td>
    to
    <td>[history | <form style="display:inline">payment</form>]</td>

    Cheers
     
    , Oct 18, 2007
    #4
  5. John Guest

    On Oct 17, 11:09 pm, wrote:
    > Hello all,
    >
    > I have the following simple html how can I display the second table
    > content like the first one. As i have add the <form>payment</form>
    > tag. Any method to remove the spacing.
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | payment]</td>
    > </tr>
    > </table>
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | <form>payment</form>]</td>
    > </tr>
    > </table>
    >
    > Thx,
    >
    > Wing


    This is a quck fix though it would be better to have all your style
    sheet code in a seperate css file
    change
    <td>[history | <form>payment</form>]</td>
    to
    <td>[history | <form style="display:inline">payment</form>]</td>

    Cheers
     
    John, Oct 18, 2007
    #5
  6. Steve Swift Guest

    > change
    > <td>[history | <form>payment</form>]</td>
    > to
    > <td>[history | <form style="display:inline">payment</form>]</td>


    I've lost the beginning of this thread, so don't know the original question.

    Whenever I'm using a <FORM> inside a <TABLE> I always place the <FORM>
    inside the <TABLE> tag but *outside* any <TD></TD> or <TR></TR> constructs.
    I discovered (by trial and error) that placing the <FORM> inside one of
    your cells or rows would lead most browsers to dump some inexplicable
    extra space somewhere, usually at the end of the last cell on the first
    row. It's most noticeable if the affected cell is centred - it fails to
    align with others in the same column.

    So:
    <TABLE>
    <FORM>
    <TR><TD>

    Add closing tags to taste.

    --
    Steve Swift
    http://www.swiftys.org.uk/swifty.html
    http://www.ringers.org.uk
     
    Steve Swift, Oct 18, 2007
    #6
  7. dorayme Guest

    In article <4718424d$>,
    Steve Swift <> wrote:

    > > change
    > > <td>[history | <form>payment</form>]</td>
    > > to
    > > <td>[history | <form style="display:inline">payment</form>]</td>

    >
    > I've lost the beginning of this thread, so don't know the original question.
    >
    > Whenever I'm using a <FORM> inside a <TABLE> I always place the <FORM>
    > inside the <TABLE> tag but *outside* any <TD></TD> or <TR></TR> constructs.
    > I discovered (by trial and error) that placing the <FORM> inside one of
    > your cells or rows would lead most browsers to dump some inexplicable
    > extra space somewhere, usually at the end of the last cell on the first
    > row. It's most noticeable if the affected cell is centred - it fails to
    > align with others in the same column.
    >
    > So:
    > <TABLE>
    > <FORM>
    > <TR><TD>
    >
    > Add closing tags to taste.


    It is like making a casserole really, anything goes eh?

    --
    dorayme
     
    dorayme, Oct 18, 2007
    #7
  8. Ben C Guest

    On 2007-10-18, Steve Swift <> wrote:
    >> change
    >> <td>[history | <form>payment</form>]</td>
    >> to
    >> <td>[history | <form style="display:inline">payment</form>]</td>

    >
    > I've lost the beginning of this thread, so don't know the original question.
    >
    > Whenever I'm using a <FORM> inside a <TABLE> I always place the <FORM>
    > inside the <TABLE> tag but *outside* any <TD></TD> or <TR></TR> constructs.


    Please don't do that! It's invalid HTML. The browser has to guess what
    you meant, somehow patch up the document tree, decide which controls are
    to go in which forms, and if the result looks and works the way you
    want, it's only because of a lot of luck.

    It could all change tomorrow or be completely different in a browser you
    haven't tested on.

    You're not alone, I see a lot of web pages where people have done this
    (and similar but worse things). Don't propagate the bad advice.

    > I discovered (by trial and error)


    Not always the best way to discover things.

    > that placing the <FORM> inside one of
    > your cells or rows would lead most browsers to dump some inexplicable
    > extra space somewhere, usually at the end of the last cell on the first
    > row.


    It's not inexplicabe, it's just a bottom margin in the quirks mode
    stylesheet put there probably for compatibility with older browsers.

    Get rid of it with form { margin-bottom: 0 } as explained in an earlier
    post.

    See also http://www.cs.tut.fi/~jkorpela/forms/tables.html
     
    Ben C, Oct 18, 2007
    #8
  9. Guest

    On Oct 17, 11:09 pm, wrote:
    > Hello all,
    >
    > I have the following simple html how can I display the second table
    > content like the first one. As i have add the <form>payment</form>
    > tag. Any method to remove the spacing.
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | payment]</td>
    > </tr>
    > </table>
    >
    > <table border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td>[history | <form>payment</form>]</td>
    > </tr>
    > </table>
    >
    > Thx,
    >
    > Wing


    This is a quck fix though it would be better to have all your style
    sheet code in a seperate css file
    change
    <td>[history | <form>payment</form>]</td>
    to
    <td>[history | <form style="display:inline">payment</form>]</td>

    Cheers
     
    , Oct 18, 2007
    #9
  10. Steve Swift Guest

    > It is like making a casserole really, anything goes eh?

    Precisely! And if, on occasions, you make a mistake (as my mother
    frequently did), and the result is tastier, that becomes your new
    recipe! http://www.swiftys.org.uk/wiz?106
    Perhaps next time I'll say "Add a soupçon of closing tags" :)

    Remember, the only "standard" that I'm designing to (in my commercial
    activity, at least) is "Must work in IE6 and the current Firefox", so
    pragmatic design outweighs hypothetical stuff. So the <FORM> tag goes
    (a) where it works, and (b) where it causes none of my target audience
    to get weird effects, then I move on to something else.

    As far as Microsoft and the Firefox developers are concerned, I should
    imagine one of their highest priorities is "Mustn't screw up legacy
    pages with new releases otherwise the customers will switch to the
    competition" so I'm happy they're looking after me.

    --
    Steve Swift
    http://www.swiftys.org.uk/swifty.html
    http://www.ringers.org.uk
     
    Steve Swift, Oct 19, 2007
    #10
  11. dorayme Guest

    In article <471998b9$>,
    Steve Swift <> wrote:

    > > It is like making a casserole really, anything goes eh?

    >
    > Precisely! And if, on occasions, you make a mistake (as my mother
    > frequently did), and the result is tastier, that becomes your new
    > recipe! http://www.swiftys.org.uk/wiz?106
    > Perhaps next time I'll say "Add a soupçon of closing tags" :)
    >
    > Remember, the only "standard" that I'm designing to (in my commercial
    > activity, at least) is "Must work in IE6 and the current Firefox", so
    > pragmatic design outweighs hypothetical stuff. So the <FORM> tag goes
    > (a) where it works, and (b) where it causes none of my target audience
    > to get weird effects, then I move on to something else.
    >


    Oh you rebel you!

    --
    dorayme
     
    dorayme, Oct 19, 2007
    #11
  12. rf Guest

    "Steve Swift" <> wrote in message
    news:471998b9$...
    >> It is like making a casserole really, anything goes eh?

    >
    > Precisely! And if, on occasions, you make a mistake (as my mother
    > frequently did), and the result is tastier, that becomes your new recipe!
    > http://www.swiftys.org.uk/wiz?106
    > Perhaps next time I'll say "Add a soupçon of closing tags" :)
    >
    > Remember, the only "standard" that I'm designing to (in my commercial
    > activity, at least) is "Must work in IE6 and the current Firefox", so
    > pragmatic design outweighs hypothetical stuff. So the <FORM> tag goes (a)
    > where it works, and (b) where it causes none of my target audience to get
    > weird effects, then I move on to something else.


    You may wish to look at this:
    http://barefile.com.au/dumpdom.html

    This merely dumps (rather crudey) the DOM for the page.

    The page is basically what you presented earlier, a couple of invalid tables
    like:
    <table>
    <form action='dumpdom.html' method=get>
    <tr><td>
    <input type=text name=textfield>
    <input type=submit name=subbutton>
    </td></tr>
    </form>
    </table>

    Use IE first. You will see that the (generated) <tbody> is a child of the
    <form> and so the input elements are also decendents of the form. So
    everything "works as expected". IE has ignored your error.

    However now use FF. You will see that the <tbody> is now not a child of the
    form. In fact the form has been "closed" before the <tbody>. The input
    elements are no longer decendants of the <form>. FF has "corrected" your
    error. The fact that the "forms" are actually submitted is quite strange. FF
    must be internally keeping some alternate representation of the page to
    cater for just this error. It is, after all, a quite common one. FWIW opera
    and Windows safari do the same thing. Hmmm, I wonder what happens if one
    converts to and serves up the above as XHTML :)

    > As far as Microsoft and the Firefox developers are concerned, I should
    > imagine one of their highest priorities is "Mustn't screw up legacy pages
    > with new releases otherwise the customers will switch to the competition"
    > so I'm happy they're looking after me.


    With that approach you will eventually get bitten in the arse by something
    you coded so sloppily years ago. In fact you have already been bitten, you
    just don't know it yet.

    See that "count" button? It finds the first form and alerts the number of
    children that form element has. IE reports this to be 1. Yep, that <tbody>.
    You could construct some javascript to drill down from the form element and
    find all the, say, input elements and do something to them, like perhaps
    validate them. All OK when you test this with IE.

    Now swap to FF. FF reports (correctly) that the form element has 0 (zero)
    children. Your validation code will silently fail (having found zero input
    elements) and you will be scratching your head for days trying to figure out
    why, unless you had previously looked at my aforementioned page and really
    knew what was happening in the DOM.

    Bite Bite :)

    --
    Richard.
     
    rf, Oct 19, 2007
    #12
  13. Ben C Guest

    On 2007-10-19, rf <> wrote:
    [...]
    > The page is basically what you presented earlier, a couple of invalid tables
    > like:
    ><table>
    ><form action='dumpdom.html' method=get>
    ><tr><td>
    ><input type=text name=textfield>
    ><input type=submit name=subbutton>
    ></td></tr>
    ></form>
    ></table>
    >
    > Use IE first. You will see that the (generated) <tbody> is a child of the
    ><form> and so the input elements are also decendents of the form. So
    > everything "works as expected". IE has ignored your error.
    >
    > However now use FF. You will see that the <tbody> is now not a child of the
    > form. In fact the form has been "closed" before the <tbody>. The input
    > elements are no longer decendants of the <form>. FF has "corrected" your
    > error. The fact that the "forms" are actually submitted is quite strange. FF
    > must be internally keeping some alternate representation of the page to
    > cater for just this error.


    I think that's right. It appears to close the form immediately, and also
    makes it display: none (otherwise CSS anonymous table boxes would be
    generated all over the place). Then it leaves the form contents where
    they are for the purposes of layout, but for the purposes of submitting
    them, associates them with something like "the most recently-seen
    buggered-up form".

    > It is, after all, a quite common one.


    I know, and all because of a harmless and easily-overridden bottom
    margin.
     
    Ben C, Oct 19, 2007
    #13
  14. still me Guest

    On Fri, 19 Oct 2007 07:18:26 GMT, "rf" <> wrote:

    >Bite Bite :)


    Comments on the below? I see that IE and FF count the children
    differently, but is it invalid ?

    <form id=form1 action='dumpdom.html' method=get>
    <table>

    <tr><td>
    <input type=text name=textfield1>
    <input type=submit name=subbutton1>

    <button onclick='childcount()'>count</button>
    </td></tr>

    </table>
    </form>
     
    still me, Oct 19, 2007
    #14
  15. rf Guest

    "still me" <> wrote in message
    news:...
    > On Fri, 19 Oct 2007 07:18:26 GMT, "rf" <> wrote:
    >
    >>Bite Bite :)

    >
    > Comments on the below? I see that IE and FF count the children
    > differently, but is it invalid ?
    >
    > <form id=form1 action='dumpdom.html' method=get>
    > <table>
    >
    > <tr><td>
    > <input type=text name=textfield1>
    > <input type=submit name=subbutton1>
    >
    > <button onclick='childcount()'>count</button>
    > </td></tr>
    >
    > </table>
    > </form>


    FF sticks in a text node for each line feed at the end of those lines up
    there. IE doesn'nt. If you visit the FF site there is a discussion about
    this in the bit where they talk about the diferences between FF and IE.

    --
    Richard.
     
    rf, Oct 20, 2007
    #15
  16. Ben C Guest

    On 2007-10-19, still me <> wrote:
    > On Fri, 19 Oct 2007 07:18:26 GMT, "rf" <> wrote:
    >
    >>Bite Bite :)

    >
    > Comments on the below? I see that IE and FF count the children
    > differently, but is it invalid ?


    It is valid.

    ><form id=form1 action='dumpdom.html' method=get>
    ><table>
    >
    ><tr><td>
    ><input type=text name=textfield1>
    ><input type=submit name=subbutton1>
    >
    ><button onclick='childcount()'>count</button>
    ></td></tr>
    >
    ></table>
    ></form>
     
    Ben C, Oct 20, 2007
    #16
  17. pidipady Guest

    pidipady, Oct 22, 2007
    #17
  18. Ben C Guest

    On 2007-10-22, pidipady <> wrote:
    > Place the closing '</form>' at the bottom of your web page just before
    > the '</body>' tag


    No, always place the closing </form> where it belongs. Remove the
    spacing by setting margin-bottom on the form element to 0.
     
    Ben C, Oct 22, 2007
    #18
  19. Steve Swift wrote:

    >> It is like making a casserole really, anything goes eh?

    >
    > Precisely! And if, on occasions, you make a mistake (as my mother
    > frequently did), and the result is tastier, that becomes your new
    > recipe! http://www.swiftys.org.uk/wiz?106


    Funny. Posting on comp.infosystems.www.authoring.html some invalid code
    that displays correctly because of bugs in specific HTML renderers is as
    ridiculous as posting on talk.grammar.english an awful grammar error,
    claiming that it's fine because Microsoft Word's grammar check feature
    doesn't find it.


    > Remember, the only "standard" that I'm designing to (in my commercial
    > activity, at least) is "Must work in IE6 and the current Firefox"


    What will happen when FF and IE6 will upgrade?

    > As far as Microsoft and the Firefox developers are concerned, I should
    > imagine one of their highest priorities is "Mustn't screw up legacy
    > pages with new releases otherwise the customers will switch to the
    > competition"


    Wrong.
    For FF, it's: "Respect standards better".
    Standards are hard enough to respect. Respecting cr*p code is secondary,
    especially when a parser change increase the standards support but affects
    cr*p code (as any parser change does).
    Even if there're a few cr*ppy tricks that are well known and that browsers
    try to respect, your FORM thing is surely not in this list.
    If would be foolish to think that any tester will ever notice that your
    cr*p is broken by the new version of FF or IE, unless your site is in of
    the top 50 of all web sites.
    If your site was in the top 50, then, maybe, IE (but probably not FF)
    would try to keep compatibility with your cr*p, at the cost of good
    insults aimed at your person, in Microsoft's labs (you can imagine them
    yourself), and maybe other tradeoffs in IE, such as reduced performances
    and standards conformance.
    Overall, you're specifically the type of guy who slow down the
    standardization of browsers, increase the number of patches and hacks in
    browsers, destroy the Web's openness by preventing alternative browsers
    from having any chance of displaying your cr*p, breaks the Web from user
    point of view by displaying stupid messages "You must have IE 6.01 beta
    3.4 + beta patch 1 or FF 1.5 beta 8 to see this site, but you've IE 6.01
    beta 3.5".

    > so I'm happy they're looking after me.


    They're not. They cannot review all the cr*p code in the world. Actually,
    they cannot even manage to get a perfect standards conformance, which is
    orders of magnitude easier than maintaining compatibility with all the
    cr*p that exist in the world.

    --
    If you've a question that doesn't belong to Usenet, contact me at
    <>
     
    André Gillibert, Oct 24, 2007
    #19
  20. still me Guest

    On Thu, 25 Oct 2007 00:12:44 +0200, "André Gillibert"
    <> wrote:

    >Overall, you're specifically the type of guy who slow down the
    >standardization of browsers, increase the number of patches and hacks in
    >browsers, destroy the Web's openness by preventing alternative browsers
    > from having any chance of displaying your cr*p, breaks the Web from user
    >point of view by displaying stupid messages



    Wow, he had all that effect just by posting a web page with misplaced
    form tags? That's some serious power!
     
    still me, Oct 26, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KatB
    Replies:
    4
    Views:
    873
  2. shruds
    Replies:
    1
    Views:
    933
    John C. Bollinger
    Jan 27, 2006
  3. michaaal
    Replies:
    21
    Views:
    1,601
  4. Stijn Goris

    can't remove horizontal spacing

    Stijn Goris, Sep 15, 2004, in forum: HTML
    Replies:
    1
    Views:
    815
    Hans Nieser
    Sep 16, 2004
  5. Replies:
    2
    Views:
    552
    Bergamot
    Jul 25, 2007
Loading...

Share This Page