By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

Use of <fieldset>/<legend> in Tables

P: n/a
Hello,

Can I use <fieldset><legend><tr><tr> </tr></tr></fieldset></legend> to
select multiple rows in a Table such that I can demarcate several rows
containing form elements in a table?

Thanks
Jan 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Els
Adam Smith wrote:
Hello,

Can I use <fieldset><legend><tr><tr> </tr></tr></fieldset></legend> to
select multiple rows in a Table such that I can demarcate several rows
containing form elements in a table?


No, you can't put anything between <table> and <tr>.
If you really need to have a form in only part of the table, you'd
need to nest another table inside a <td>.
Another option is to have the <form> and <fieldset> tags outside the
entire table.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Eurythmics & Aretha Franklin - Sisters Are Doing It For
Themselves
Jan 12 '06 #2

P: n/a
Adam Smith wrote:
Can I use <fieldset><legend><tr><tr> </tr></tr></fieldset></legend> to
select multiple rows in a Table such that I can demarcate several rows
containing form elements in a table?


No.

Invalid nesting,
<fieldset><legend><tr></tr> <tr></tr></legend></fieldset>
would be correctly nested.
But it's still invalid, because FIELDSET is not a valid child for a TBODY
element. You cannot put anything 'around' one or more table rows (except
for THEAD, TBODY or TFOOT, with TBODY being implied, if you omit the start
and/or end tag of it).

You cannot even put a TABLE into the LEGEND, because only inline elements
are allowed there and TABLE is a block element.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Jan 12 '06 #3

P: n/a
Els
Benjamin Niemann wrote:
But it's still invalid, because FIELDSET is not a valid child for a TBODY
element. You cannot put anything 'around' one or more table rows (except
for THEAD, TBODY or TFOOT, with TBODY being implied, if you omit the start
and/or end tag of it).


I keep forgetting to mention thead etc when saying nothing is allowed
between table and tr :\

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Christina Aguilera - Cruz
Jan 12 '06 #4

P: n/a
Els wrote:
Adam Smith wrote:

Hello,

Can I use <fieldset><legend><tr><tr> </tr></tr></fieldset></legend> to
select multiple rows in a Table such that I can demarcate several rows
containing form elements in a table?

No, you can't put anything between <table> and <tr>.


Except thead, tbody, tfoot.
If you really need to have a form in only part of the table, you'd
need to nest another table inside a <td>.


The usual motivation for this kind of thing is to obtain uniform column
widths from one form to the next, but unfortunately you can't accomplish
that with valid HTML. CSS will do it if min-width and max-width are
strictly applied by the browser.
Jan 12 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.