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 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    show/hide table with a click

    Hi

    i want to hide a table when user click on a link

    this is my code looks like

    PHP Code:
    <div id="sh">
    <
    table width="800" border="0">
      <
    tr>
        <
    td></td>
        <
    td></td>
        <
    td></td>
      </
    tr>
    </
    table>
    </
    div>

    <
    div align="center"><a href="JavaScript:window.print();"><img src="images/print.png" alt="Print this page"/></a></div
    is it possible to hide above table at same time print this link clicked?

    any help would be great


    sorry for language errors

    Regards.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Code:
    <div align="center"><a href="JavaScript:window.print()"; onclick = "document.getElementById('sh').style.display='none';"><img src="images/print.png" alt="Print this page"/></a></div>

    You may also use style.visibility = "hidden" if you wish the element being hidden to still occupy its same place in the layout of the page.


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks


  •  

    Posting Permissions

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