Jump to content

Form tags


limages

Recommended Posts

I wouldn't use tables at all. Use semantic markup
Thanks, GH4. I appreciate the link. The article looks great. I'm taking a CSS/xhtml course now and maybe they'll address this (or I'll bring it up!)Right now though, I'm desperately short of time and need to revise a site to include some button creation code. That's why I asked about the form tags.
Link to comment
Share on other sites

I question the wisdom of doing so, but yes, you can put an entire form within a table cell. Tables and forms go wrong in other ways. Here are three:Problem 1. The form tags exist inside a thing that is not a true content holder. Like putting your <form> tag between the <table> tag and a <tr> tag. There's no "there" there. Same problem putting it between a <tr> and a <td>. The form isn't really contained by anything. The only content holder in a table is the cell. Text, image, SWF -- if it's going in a table, you have to put it in a cell.Problem 2. The form tags open and close across cell boundaries. If a form is opened in a table cell, it must close inside the same cell.Problem 3. One form tag in the table, one form tag outside the table.It must be said that rational humans rarely make such mistakes. You'll see such code out there, but chances are good it was generated by one of the early WYSIWYG editors, which had big problems integrating forms and tables. Maybe they still do, I don't know.Now, to be fair, lots of forms really do collect tabular data, so the combination of forms and tables remains plausible. But it is hard to see the rationale behind putting a form inside a single cell (despite its syntactic legitimacy).

Link to comment
Share on other sites

I question the wisdom of doing so, but yes, you can put an entire form within a table cell. Tables and forms go wrong in other ways. Here are three:Problem 1. The form tags exist inside a thing that is not a true content holder. Like putting your <form> tag between the <table> tag and a <tr> tag. There's no "there" there. Same problem putting it between a <tr> and a <td>. The form isn't really contained by anything. The only content holder in a table is the cell. Text, image, SWF -- if it's going in a table, you have to put it in a cell.Problem 2. The form tags open and close across cell boundaries. If a form is opened in a table cell, it must close inside the same cell.Problem 3. One form tag in the table, one form tag outside the table.It must be said that rational humans rarely make such mistakes. You'll see such code out there, but chances are good it was generated by one of the early WYSIWYG editors, which had big problems integrating forms and tables. Maybe they still do, I don't know.Now, to be fair, lots of forms really do collect tabular data, so the combination of forms and tables remains plausible. But it is hard to see the rationale behind putting a form inside a single cell (despite its syntactic legitimacy).
Thanks, DD.I know, I felt the same way. In fact, I thought that you COULDN'T put form tags inside a table (I created the problems you mention). This particular code snippet actually is placed within cells, so I guess that's why in this instance I was able to validate when I never could before I tried to put a form inside a table.Thanks for your commentary. I'm so interested in learning as much as I can and your insight helps a lot.Limages
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...