DIV encompassing TD

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

    DIV encompassing TD

    Can anyone tell me how I can make the following work...

    <table>
    <div id="1">
    <tr><td>testing </td></tr>
    </div>

    <input type="button" value="test" onClick="javasc ipt:removeQuest ion('1','1')">
    </table>

    The Javascript will not recognize the div because it is wrapped in TR and TD.
  • Els

    #2
    Re: DIV encompassing TD

    Falc2199 wrote:
    [color=blue]
    > Can anyone tell me how I can make the following work...
    >
    > <table>
    > <div id="1">
    > <tr><td>testing </td></tr>
    > </div>
    >
    > <input type="button" value="test" onClick="javasc ipt:removeQuest ion('1','1')">
    > </table>
    >
    > The Javascript will not recognize the div because it is wrapped in TR and TD.[/color]

    No, the div isn't wrapped in TR and TD.
    You wrapped the TR and TD in the div.
    I have absolutely now idea what you are trying to do here,
    but I do know that correct markup would be putting the div
    inside the td. You can't put anything between the table and
    its rows.

    --
    Els
    Blog and other pages, mostly outdated.

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -

    Comment

    • Knud Gert Ellentoft

      #3
      Re: DIV encompassing TD

      JehanNYNJ@aol.c om (Falc2199) skrev :
      [color=blue]
      ><table>
      ><div id="1">
      ><tr><td>testin g</td></tr>
      ></div>
      >
      ><input type="button" value="test" onClick="javasc ipt:removeQuest ion('1','1')">
      ></table>
      >
      >The Javascript will not recognize the div because it is wrapped in TR and TD.[/color]

      You can't have a <div> or a input between <table> and <tr>, try
      it in the <td>.

      <table>
      <tr>
      <td>
      <div id="1">testing </div>
      <div><input type="button" value="test"</div>
      onClick="javasc ipt:removeQuest ion('1','1')">
      </td>
      </tr>
      <table
      --
      Knud

      Comment

      • David Dorward

        #4
        Re: DIV encompassing TD

        Falc2199 wrote:
        [color=blue]
        > Can anyone tell me how I can make the following work...
        >
        > <table>
        > <div id="1">
        > <tr><td>testing </td></tr>
        > </div>
        > <input type="button" value="test"
        > onClick="javasc ipt:removeQuest ion('1','1')"> </table>[/color]

        Use the validator and get your HTML straight before worrying about the
        JavaScript.

        W3C's easy-to-use markup validation service, based on SGML and XML parsers.


        (1) <table> can directly contain ONLY <tbody>, <thead>, <tfoot>, or <tr> NOT
        <div> or <input>
        (2) Ids of elements MUST begin with a LETTER.

        It would also help to know what you are trying to do, <div> elements are not
        magic, its possible that you could script the row itself (depending on what
        you are trying to do).

        You seem to have chosen an odd forum for this question -
        comp.lang.javas cript would seen more suited to it (although the problem
        itself (your HTML isn't HTML) is better directed to
        comp.infosystem s.www.authoring.html.

        --
        David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
        Home is where the ~/.bashrc is

        Comment

        Working...