472,124 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,124 software developers and data experts.

table inside form?

It is ok tu use a table tag inside a form tag?

(you know, you do not use h2 inside p, etc...)

--
Luciano A. Ferrer
la**************@SacaDMEgmail.com
.... un todo en uno y uno en todo
Apr 1 '06 #1
14 19182
This idea is very possible, though I have never tried it. It should
not mess up the HTML code, but if it does, you can just preview the
site in IE and then check the Error Warning sign in the bottom left
corner. I have had some simple errors in my site, but those were
discerned through this method. It actually caught a mispelling that I
made in a JavaScript, so it should catch most other problems.

_________________________________________

Patrick Reilly
1st Coy.
Colonel Seth Warner's Regiment

Apr 1 '06 #2
Luciano A. Ferrer wrote:
It is ok tu use a table tag inside a form tag?


Syntactically it is fine. Semantically it may or may not be.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Apr 1 '06 #3
In article <e0**********@tramontana.micasa.mired>,
Luciano A. Ferrer <al************@arnet.com.ar> wrote:
It is ok tu use a table tag inside a form tag?


Yes, in fact this is quite common. It validates correctly too.

Form tags can contain anything, sort of like div tags.

-A
Apr 1 '06 #4
Gazing into my crystal ball I observed "Luciano A. Ferrer"
<al************@arnet.com.ar> writing in news:e0ktbi$7md$2
@tramontana.micasa.mired:
It is ok tu use a table tag inside a form tag?

(you know, you do not use h2 inside p, etc...)


Yes, you can put a table inside a form, which is what a lot of people do to
line up input elements, but there is a better way using CSS.

Here's an example:
<URL:http://www.intraproducts.com/usenet/requiredform.asp>

--
Adrienne Boswell
Please respond to the group so others can share
http://www.cavalcade-of-coding.info
Apr 1 '06 #5
axlq wrote:
Form tags can contain anything, sort of like div tags.


Not true.

<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->

Anything in the group "block" and script elements but not form elements.

<!ELEMENT DIV - - (%flow;)* -- generic language/style
container -->

Anything in the group "flow" (which includes everything in "block" but
also "inline".

(At least for HTML 4.01 Strict).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Apr 1 '06 #6
In article <Xn****************************@69.28.186.121>,
Adrienne Boswell <ar********@sbcglobal.net> wrote:
Yes, you can put a table inside a form, which is what a lot of
people do to line up input elements, but there is a better way
using CSS.

Here's an example:
<URL:http://www.intraproducts.com/usenet/requiredform.asp>


I disagree that's a better way. Discounting the fact that this
example is XHTML and not HTML, bear in mind that one of the
advantages of CSS is to reduce the bandwidth required to serve up
a page. In the example above, it seems to me that a table-based
for a form would be simpler, easier to understand, and consume less
bandwidth.

A table is entirely appropriate when you want to maintain both a
horizontal and vertical relationship between displayed elements.
That's what it's for.

-A
Apr 1 '06 #7
In article <e0*******************@news.demon.co.uk>,
David Dorward <do*****@yahoo.com> wrote:
axlq wrote:
Form tags can contain anything, sort of like div tags.


Not true.


I stand corrected; you can't have a form within a form, of course.

-A
Apr 1 '06 #8
axlq wrote:
I stand corrected; you can't have a form within a form, of course.


No, for example, can they directly contain free text, or form controls.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Apr 1 '06 #9
Gazing into my crystal ball I observed ax**@spamcop.net (axlq) writing in
news:e0**********@blue.rahul.net:
In article <Xn****************************@69.28.186.121>,
Adrienne Boswell <ar********@sbcglobal.net> wrote:
Yes, you can put a table inside a form, which is what a lot of
people do to line up input elements, but there is a better way
using CSS.

Here's an example:
<URL:http://www.intraproducts.com/usenet/requiredform.asp>


I disagree that's a better way. Discounting the fact that this
example is XHTML and not HTML, bear in mind that one of the
advantages of CSS is to reduce the bandwidth required to serve up
a page. In the example above, it seems to me that a table-based
for a form would be simpler, easier to understand, and consume less
bandwidth.

A table is entirely appropriate when you want to maintain both a
horizontal and vertical relationship between displayed elements.
That's what it's for.

-A


Bandwidth? 3463 bytes with a table and 3125 bytes with CSS and no tables,
and that would be further reduced because one would use an external
stylesheet.

CSS HTML 4.0 <URL:http://www.cavalcade-of-
coding.info/usenet/requiredform.html>
Table HTML 4.0 <URL:http://www.cavalcade-of-
coding.info/usenet/requiredform_table.html>

In recreating the form using tables, I found it to not be simpler at all.
Getting the form to display the same way using HTML attributes vs CSS
properties was not easy, and is still not quite right.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.cavalcade-of-coding.info
Apr 1 '06 #10
ax**@spamcop.net (axlq) wrote in news:e0**********@blue.rahul.net:
In article <Xn****************************@69.28.186.121>,
Adrienne Boswell <ar********@sbcglobal.net> wrote:
Yes, you can put a table inside a form, which is what a lot of
people do to line up input elements, but there is a better way
using CSS.

Here's an example:
<URL:http://www.intraproducts.com/usenet/requiredform.asp>

I disagree also, but for different reasons. I tell my students that
any time they are using <br> very often, they should rethink what they
are doing. I have no problem using a table in a form as it is my
opinion that the labels and inputs constitute tabular data.
I disagree that's a better way. Discounting the fact that this
example is XHTML and not HTML, bear in mind that one of the
advantages of CSS is to reduce the bandwidth required to serve up
a page. In the example above, it seems to me that a table-based
for a form would be simpler, easier to understand, and consume less
bandwidth.
The example being XHTML rather than HTML really makes no difference to
the discussion. Also, I don't think the example would use any more
bandwidth than using a table; all of the extra stuff you see there
(javascript) could be used as easily with a table as with the code in
the example.
A table is entirely appropriate when you want to maintain both a
horizontal and vertical relationship between displayed elements.
That's what it's for.


No, that's not what a table is for. You are thinking layout instead of
semantics. A table is to contain tabular data. Whether it lines up or
not is an irrelevant presentational issue. But I do agree that a table
is appropriate for the reason I gave above.

--
Stan McCann, "Uncle Pirate" http://stanmccann.us/
Webmaster, NMSU Alamogordo http://alamo.nmsu.edu/
Implementing http://blinkynet.net/comp/uip5.html
Apr 1 '06 #11
Luciano A. Ferrer wrote :
It is ok tu use a table tag inside a form tag?

(you know, you do not use h2 inside p, etc...)

One easy and quick way to know is to visit this page:

http://www.htmlhelp.org/reference/html40/alist.html

then click on the element (e.g. table) and then read the "Contents" and
"Contained in" paragraphs.

Another way is to validate your webpage with the W3C HTML validator.

http://validator.w3.org/

Since you'll most likely benefit from validating your page anyway (it
will report any other errors you may have), you might as well use this way.

Gérard
--
remove blah to email me
Apr 2 '06 #12
In article <Xn************************@216.234.192.142>,
Stan McCann <me@stanmccann.us> wrote:
A table is entirely appropriate when you want to maintain both a
horizontal and vertical relationship between displayed elements.
That's what it's for.
No, that's not what a table is for. You are thinking layout instead of
semantics.


No, I'm thinking strictly in terms of tabular data, in which you
want to maintain a horizontal and vertical relationship between
displayed elements. As I said, that's what a table is for. We agree
that it's appropriate in this case.

The other argument I made, that a table will consume less bandwidth
than doing the same thing in CSS, is apparently wrong. In that
case, I would argue that if there's no bandwidth advantage, why
bother with CSS? At least with a table, a casual reader of the
source code can figure out the tabular relationship, which isn't
clear with CSS.
A table is to contain tabular data. Whether it lines up or
not is an irrelevant presentational issue.


It's very relevant for tabular data... which we both agree this is.

-A
Apr 2 '06 #13
Sat, 1 Apr 2006 15:50:35 +0000 (UTC) from axlq <ax**@spamcop.net>:
In article <e0**********@tramontana.micasa.mired>,
Luciano A. Ferrer <al************@arnet.com.ar> wrote:
It is ok tu use a table tag inside a form tag?


Yes, in fact this is quite common. It validates correctly too.

Form tags can contain anything, sort of like div tags.


More specifically, as I discovered when I posted a question here a
week or so ago, they can contain any block-type element. I you simply
put controls like <input> directly inside the form, it fails
validation as Strict but succeeds as Transitional.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Apr 2 '06 #14
Greetings.

In article <e0**********@blue.rahul.net>, axlq wrote:
In article <Xn************************@216.234.192.142>,
Stan McCann <me@stanmccann.us> wrote:
A table is entirely appropriate when you want to maintain both a
horizontal and vertical relationship between displayed elements.
That's what it's for.


No, that's not what a table is for. You are thinking layout instead of
semantics.


No, I'm thinking strictly in terms of tabular data, in which you
want to maintain a horizontal and vertical relationship between
displayed elements. As I said, that's what a table is for. We agree
that it's appropriate in this case.


No we don't. A table is a matrix where there is a clear semantic
relationship among each element in a column, and also among each element
in a row. This is not necessarily the case for a matrix of form elements.

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Apr 3 '06 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Amir Hardon | last post: by
5 posts views Thread by brian4cards | last post: by
5 posts views Thread by Richard Dixson | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.