|
Posted by Tim Streater on 07/07/07 16:33
In article <slrnf8ultt.sl3.spamspam@bowser.marioworld>,
Ben C <spamspam@spam.eggs> wrote:
> On 2007-07-06, Tim Streater <timstreater@waitrose.com> wrote:
> > In article <slrnf8tj98.sl3.spamspam@bowser.marioworld>,
> > Ben C <spamspam@spam.eggs> wrote:
> [...]
> >> Firefox in quirks mode gives form a bottom margin of about 0.5em.
> >>
> >> You can fix your problem in two ways, of which you should do at least
> >> the second and possibly both:
> >>
> >> form { margin: 0 }
> >>
> >> in the styles
> >>
> >> or use the strict mode doctype, i.e. put this right at the top of every
> >> document:
> >>
> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> >> "http://www.w3.org/TR/REC-html40/strict.dtd">
> [...]
> >> Even worse someone suggested on one of these NGs the other day "fixing"
> >> the same problem by using broken form/table structure. It seems you were
> >> starting to circle the same drain. I wonder how many of the broken
> >> forms/tables I see every day on the web are caused by people trying
> >> anything to make that bottom margin go away.
> >
> > OK. So are you saying that I shouldn't put a <form> inside a table cell?
>
> Not at all, <form> inside <td> is fine, but nest the tags properly--
> </form> before </td>.
>
> Then set margin:0 on form to lose that bottom margin and you should have
> no problems.
Funnily enough I tried this at work before going home (my posts to this
group were from home late Fri evening). I must have formatted it
incorrectly somehow as it appeared to have no effect.
The doctype makes Firefox behave, but not Safari, but the margin:0 sorts
out Safari too.
> > I want to have an action button in my table row. I want to have valid
> > html though, as in my experience hacks will bite you sooner or later. I
> > made each cell have its own form, because I couldn't find in any of the
> > docs I have whether a form can be submitted by any one of several
> > buttons. All the examples I ever saw only had one button, and the docs
> > didn't appear to cover the point.
>
> Not sure if you can have multiple submit buttons in a single form or
> not.
>
> http://www.cs.tut.fi/~jkorpela/forms/tables.html might also be worth a
> look.
Thanks for your help and these links - most informative. Everyone's
contributions of "further reading" links are much appreciated.
[Back to original message]
|