473,513 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LABEL Element in a 2-dimensional table

How do you use a LABEL tag within a two dimensional table? In the
examples I've seen for this element, only extremely simple situations
are shown, e.g., <LABEL FOR="wgt">Weight:</LABEL><INPUT TYPE="TEXT"
ID="wgt">
But what if you have ...
<TABLE>
<TR>
<TH>WEIGHT</TH>
<TH>HEIGHT</TH>
</TR>
<TR>
<TD>Girls</TD>
<TD>INPUT TYPE="TEXT" ID="girlwgt"</TD>
<TD>INPUT TYPE="TEXT" ID="girlhgt"</TD>
<TR>
<TD>Boys</TD>
<TD>INPUT TYPE="TEXT" ID="boywgt"</TD>
<TD>INPUT TYPE="TEXT" ID="boyhgt"</TD>
<TR>
</TABLE>
The label "WEIGHT" in the header refers to both id=girlwgt and
id=boywgt; similarly, the label "Girls" refers to both id=girlwgt and
id=girlhgt.
Do you perhaps use two LABEL elements for each label? Or do you have
only one LABEL element, but with multiple id subelements???
Jul 20 '05 #1
1 1942
Will Handley wrote:
How do you use a LABEL tag within a two dimensional table?
Is there another kind? I don't think 3d tables, the kind that an
Excel workbook can create, are possible using HTML.
In the examples I've seen for this element, only extremely simple
situations are shown, e.g., <LABEL FOR="wgt">Weight:</LABEL><INPUT
TYPE="TEXT" ID="wgt"> But what if you have ... <TABLE>
<TR>
<TH>WEIGHT</TH>
<TH>HEIGHT</TH>
</TR>
<TR>
<TD>Girls</TD>
<TD>INPUT TYPE="TEXT" ID="girlwgt"</TD>
<TD>INPUT TYPE="TEXT" ID="girlhgt"</TD>
<TR>
<TD>Boys</TD>
<TD>INPUT TYPE="TEXT" ID="boywgt"</TD>
<TD>INPUT TYPE="TEXT" ID="boyhgt"</TD>
<TR>
</TABLE>
Your table is invalid: the rows do not have the same number of
columns. That said, the label element cannot point to two form fields.

http://www.w3.org/TR/html401/interac...tml#edef-LABEL
"The LABEL element may be used to attach information to controls. Each
LABEL element is associated with exactly one form control."
The label "WEIGHT" in the header refers to both id=girlwgt and
id=boywgt; similarly, the label "Girls" refers to both id=girlwgt and
id=girlhgt.


The table markup, without a label element, creates a relationship
between the cells of a row. If you wanted, you could add some markup
to the table, e.g., th elements with scope attribute.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9316
by: Mikko | last post by:
Is it possible to read "label" from form-field? <label for="product1">bread</label> <input id="product1" name="product1" type="text" size="3"> number comes with $_GET; but how do I read the...
10
31664
by: Dwizz | last post by:
Hello, I really hope that someone can help me resolve my problem, I've been working on it for the past few days, to no avail. I have an asp:label which gets its value from the database, but what...
2
6520
by: localhost | last post by:
How can I style a TextBox so it appears like a label when rendered? Thanks.
3
3791
by: Josef K. | last post by:
Asp.net generates the following html when producing RadioButton lists: <td><input id="RadioButtonList_3" type="radio" name="MyRadioButtonList" value="644"...
1
3000
by: Alex Maghen | last post by:
I'm taking text from a multi-line TextBox into a database. Then, on other pages, I'm displaying that text as read-only. But the problem is, when I set the Text property of a Label control to that...
4
3954
by: Charlotte | last post by:
Hello I was wondering if anyone could tell me how i can change a label dynamically with each click on the label?? Thanks Charly
7
1806
by: Smokey Grindle | last post by:
How can you correctly use the <labelelement in asp.net? does the label custom control corelate to this tag correctly in the same way in that if you click it it will select the tied element? thanks
3
5629
by: Ralph | last post by:
Hi I have small function to generate my form controls: function buildInput(sType, vValue, vId, sName, sLabel){ var oInput = null; var oLabel = document.createElement('label'); var oCont =...
4
24434
by: pradeep | last post by:
how to set input type label's value through javascript
5
2957
by: SuneR | last post by:
Hi, I am having problems figuring out how to make Firefox behave, and output the HTML I want it to output. The thing I want done is actually quite simple. I have a <labeltag, and inside it, I...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7166
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7106
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5689
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.