forms allowed in tables?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Are forms allowed in tables?

Re: forms allowed in tables?

okey wrote:

Quoted text here. Click to load it

Yes, but only inside a td (or, in theiry, th) element.

What is your _real_ problem? URL?

Yucca, /

Re: forms allowed in tables?

Quoted text here. Click to load it

This turned out to be interesting... Thanks all for you input.  I
wound up at the w3c site and put together these notes from the
"strict" dtd.

(( Notes: % LanguageCode "NMTOKEN"  <!-- a language code, as per
[RFC3066] -->
       % i18n    "lang        %LanguageCode; #IMPLIED
                  xml:lang    %LanguageCode; #IMPLIED
                  dir         (ltr|rtl)      #IMPLIED"
       % coreattrs "id          ID             #IMPLIED
                    class       CDATA          #IMPLIED
                    style       %StyleSheet;   #IMPLIED
                    title       %Text;         #IMPLIED"
       % events "onclick     %Script;       #IMPLIED
                 ondblclick  %Script;       #IMPLIED
                 onmousedown %Script;       #IMPLIED
                 onmouseup   %Script;       #IMPLIED
                 onmouseover %Script;       #IMPLIED
                 onmousemove %Script;       #IMPLIED
                 onmouseout  %Script;       #IMPLIED
                 onkeypress  %Script;       #IMPLIED
                 onkeydown   %Script;       #IMPLIED
                 onkeyup     %Script;       #IMPLIED"
       % attrs "%coreattrs; %i18n; %events;"
       % inline.forms  "input | select | textarea | label | button"
       % misc.inline   "ins | del | script"
       % misc          "noscript | %misc.inline;"
       % special.pre   "br | span | bdo | map">
       % special       "%special.pre; | object | img "
       % phrase        "em | strong | dfn | code | q | samp | kbd |
var | cite | abbr | acronym | sub | sup ">
       % inline        "a | %special; | %fontstyle; | %phrase; |

<!ELEMENT table    (caption?, (col*|colgroup*), thead?, tfoot?, (tbody
<!ELEMENT caption  %Inline;>  "(#PCDATA | %inline; | %misc.inline;)*"
<!ELEMENT thead    (tr)+>
<!ELEMENT tfoot    (tr)+>
<!ELEMENT tbody    (tr)+>
<!ELEMENT colgroup (col)*>
<!ELEMENT col      EMPTY>
<!ELEMENT tr       (th|td)+>
<!ELEMENT th       %Flow;>  "(#PCDATA | %block; | form | %inline; |
<!ELEMENT td       %Flow;>  "(#PCDATA | %block; | form | %inline; |

<!ATTLIST table
  summary     %Text;         #IMPLIED
  width       %Length;       #IMPLIED
  border      %Pixels;       #IMPLIED
  frame       %TFrame;       #IMPLIED "(void|above|below|hsides|lhs|
  rules       %TRules;       #IMPLIED "(none | groups | rows | cols |
  cellspacing %Length;       #IMPLIED
  cellpadding %Length;       #IMPLIED

<!ATTLIST caption

Turns out you can put forms in tables, just like you said, but not
where I did.  I had the form tag in the noman's zone right after the
table tag.  Sometimes it worked, sometimes not.  I now have a link to
the dtd.  Thanks again.

Re: forms allowed in tables?

Quoted text here. Click to load it

They're allowed in tds (and probably ths) which must be in trs and those
are allowed in tables.

If in doubt, check with a validator. /

Re: forms allowed in tables?

in news:08a58b13-b5ac-45cd-b1f9-

Quoted text here. Click to load it

So, I am assuming that you want something like:

    <form method="post" action="action">
        <td>Field</td><td><input type="text" name="field"></td>
        <td>Enter</td><td><input type="submit" value="Submit"></td>

Please don't do this.  Please don't abuse tables.  Much better:

<div id="nav">
<li><a href="index.php">Home</a></li>
<div id="content">
<form method="post" action="action">
<label for="field">Field</label> <input type="text" name="field"
<input type="submit" value="Submit">
<div id="sidebar">
<!-- your content here -->
Adrienne Boswell at Home
Arbpen Web Site Design Services
Please respond to the group so others can share

Re: forms allowed in tables?

Quoted text here. Click to load it

Web Authoring FAQ from Web Design Group
10.3. How can I use tables to structure forms?

Website design resources: Learning HTML and CSS #=

regards, G=E9rard
Internet Explorer 7 bugs: 175 bugs so far /
Internet Explorer 8 bugs: 49 bugs so far /

Site Timeline