LABEL Element in a 2-dimensional table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Will Handley

    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">Weigh t:</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???
  • Brian

    #2
    Re: LABEL Element in a 2-dimensional table

    Will Handley wrote:[color=blue]
    > How do you use a LABEL tag within a two dimensional table?[/color]

    Is there another kind? I don't think 3d tables, the kind that an
    Excel workbook can create, are possible using HTML.
    [color=blue]
    > In the examples I've seen for this element, only extremely simple
    > situations are shown, e.g., <LABEL FOR="wgt">Weigh t:</LABEL><INPUT
    > TYPE="TEXT" ID="wgt"> But what if you have ...[/color]
    [color=blue]
    > <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>[/color]

    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.


    "The LABEL element may be used to attach information to controls. Each
    LABEL element is associated with exactly one form control."
    [color=blue]
    > 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.[/color]

    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

    Comment

    Working...