Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to hide a DIV with table formatting

    I am trying to hide the contents of a DIV but can't seem to get it to work.
    The contents don't hide unless I take out the table formatting. Is there a way to get this to work with the formatting?

    <div id="spo" style="display: none">
    <!-- <td>Audit Number:</td>
    <td><input type="text" name="audit"></td> -->
    test
    </div>

    <div id="not_spo" style="display: none">
    <tr><td>LID Number:</td>
    <td><input type="text" name="lid"></td>
    <td>BaaN Number:</td>
    <td><input type="text" name="baan"></td></tr>
    </div>

    I have also tried visibility:hidden

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Quote Originally Posted by JJ0117 View Post
    <div id="not_spo" style="display: none">
    <tr><td>LID Number:</td>
    <td><input type="text" name="lid"></td>
    <td>BaaN Number:</td>
    <td><input type="text" name="baan"></td></tr>
    </div>
    That construct isn't valid; a table row (tr) element must be the child of a table element — the table element is missing in that code.

    Code:
    CSS:
    #not_spo {display: none;}
    
    HTML:
    <div id="not_spo">
      <table> 
        <tr>
          <td><abbr title="">LID</abbr> Number:</td>
          <td><input type="text" name="lid"></td>
          <td><abbr title="">BaaN</abbr> Number:</td>
          <td><input type="text" name="baan"></td>
        </tr>
      </table>
    </div>
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •