[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 528
  • Last Modified:

how to change the visibility of a td so to print or not print it

I print 2 copies of my webpage using javascript.
In between the 2 statements I need to swap visibilty of 2 td's so I can display the text differently in the 2 print.The following code doesnt seem to help. thank
<script type="text/javascript">
    function Print() {

       var tblStore = document.getElementById("<%= tblDash.ClientID %>");
       tblStore.style.display = 'none';

       var tblCustomer = document.getElementById("<%= tblCustomerCopy.ClientID %>");
       tblCustomer.style.display = 'block';

       var clickButton = document.getElementById("<%= lnkHome.ClientID %>");
3 Solutions
Michel PlungjanIT ExpertCommented:
The printing is busy when you try to print the second time

try copying the stuff to a new window for second print
Roopesh ReddyCommented:

You can try onbeforeprint event!


NOTE: It works only in IE, Firefox and may be safari!

Hope it helps u...

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now