Hey, I have a problem that if you use a table in a form tag then at the end of your form tag you always have a REALLY big gap and it looks daft. there are no <p> or <br> or anything but it still does it. Is there any solution?

Thanks!

    That's probably because <form> acts like a paragraph.

    You'll just have to re-structure your html.

      </form> tags are block level elements in HTML, which, be default, have line breaks around them.

      With CSS, you can set block level elements to be displayed as inline, which should eliminate the line breaks.

      form {
      display: inline;
      }

      As an alternative, you can omit the ending </form> tag if you dont have any other forms below it, AND if you open your form like this:

      <form method="post" action="/action.php" />

      Note the closing /> which indicates an empty element...

        This is a problem inherent to IE. I highly suggest moving to a decent browser like Mozilla which is W3C compliant.

        If you still wish to use a gimpy browser like IE though, there is a work around. Place your form tags either OUTSIDE the table tags or embed them between a table row and a table cell tag

        <form>
        <table>
        <tr>
        <td>
        <input type=text name=bob>
        </td>
        </tr>
        </table>
        </form>

        or...

        <table>
        <tr>
        <form>
        <td>
        <input type=text name=bob>
        </td>
        </form>
        </tr>
        </table>

        Sure this may not be kosher HTML but it gets the job done when you need to render stuff in crappy IE.

          your best bet is to code in IE a crappy browser, since it is what most of the market uses...
          If you code in mozilla, what you get in IE can look completely difference and screwed up. Cater to the majority if youre lazy, otherwise find the right code to make it look the same on all browsers

            Maybe if you are using an old version but anything beyond 1.0 will pretty much render the exact same thing.

            I work for a Microsoft vendor and all I use IS Mozilla for all my web surfing AND development. It's exactly the same (except where Microsoft is gimped and Mozilla isn't).

            Besides, as I said earlier, Mozilla is W3C compliant and now owns over 9% of the web thanks to it being bundled with Lindows, Red Hat, OpenBSD, FreeBSD, Debian and the many other flavors of *Nix. 🙂

            Go open source whenever you can that way we can support web standards rather than Microsoft standards. 🙂

              My solutions both work fine... don't they?

              In any case foofoobar, its not always a case of what the DEVELOER uses for a web browser... if you're going to be any kind of real web developer... you better learn HTML that works on ALL BROWSERS, or at least a vast majority. Otherwise that other 91% that DOESN'T use Mozilla is goin to be might upset...

                Well duh. That's obvious. I just said IE was gimpy and that started this convo. Until they can follow W3C guidelines for web standards, they are still Gimpy.

                Never said anything about coding for any particular browser and don't know how you got that out of what I said.

                  Another CSS solution:

                  form 
                  {
                    margin: 0;
                    padding: 0;
                  }
                  

                    or... if you dont mind, just do this:

                    <table>
                    <form>
                    <tr>
                    <td> [...]
                    </td>
                    </tr>
                    </form>
                    </table>

                    This should not be the solution but it is a simple hack.

                      Yep. I already mentioned that.

                      And the fact that it's required because IE is gimpy. 🙂

                        Thanks guys, for the arguments and all :p Will try the CSS method out. I woudl quite like to get into using it more.

                          Write a Reply...