W3C home > Mailing lists > Public > www-html@w3.org > November 2003

Re: XHTML and form elements

From: Toby A Inkster <tobyink@goddamn.co.uk>
Date: Thu, 6 Nov 2003 23:56:36 +0000
To: Emlyn Addison <emlyn@neinetwork.com>
Cc: www-html@w3.org
Message-ID: <20031106235636.GB26314@ophelia.goddamn.co.uk>
On Thu, Nov 06, 2003 at 10:17:49AM -0500, Emlyn Addison wrote:
| I've had my hand slapped for posting this to the wrong forum:
| 
| 1. Why is XHTML considered invalid if form elements are split between 
| the cells of a table [used for layout purposes]?

They're not. See the valid XHTML 1.1 below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head><title>Example</title></head>
  <body>
    <form action="#" method="get">
      <table>
        <tr>
          <td><label for="myinput">Name:</label></td>
          <td><input id="myinput" name="myinput" /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" /></td>
        </tr>
      </table>
    </form>
  </body>
</html>

| 2. Why do the <form> and </form> elements include [seemingly useless] 
| vertical spacing if they're invisible?

They don't. The XHTML specs don't specify any spacing around a form,
although browsers are free to implement it. Most would let you override
that using CSS though.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Received on Thursday, 6 November 2003 18:56:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:09 UTC