• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form not allowed in table tag?

 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks, got a quick question for anyone who knows the standards:
Is a form tag not really allowed to be inside of a table tag?
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you literally mean inside a table tag? Or do you mean inside a td tag? Inside table cells, yes.
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand what you mean by the difference, but I really meant in general--either one. A form tag isn't supposed to be anywhere within a table or tr or td tag, right?
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure, for sure. I've never had problems using forms within table cells. I've had some problems nesting a table in a form, where the table had some form input fields. I suppose you could check out the XHTML DTD and see for sure what elements allow a form inside it. Have you gone that route?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if there is some new XHTML thing that bans this, but I doubt it....

Eric
[ April 23, 2004: Message edited by: Eric Pascarello ]
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at the XHTML DTD (which though you may not be using, will closely mirror the expectations of the rendering browser), table only allows certain elements (none of which is a form or form-derived element:

Well you get the idea. Solution #2 of course is simpley not well-formed, so that will croak every time. #3 and #4 as you say are just fine, so I would try and cram whatever design you need into something similar to those.
The XHTML DTD can be found at: here.
[ April 23, 2004: Message edited by: Nathaniel Stoddard ]
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, good to know. One issue I've noticed (in at least IE 6) is that when there are two forms on a page, my browser got confused about which one was being submitted when I would just hit Enter. I will try to move the site away from table-based design in general to hopefully avoid other little quirks and just plain maintenance annoyance...
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic