Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
gridview getting squished in the printout

I am trying to print the gridview using javascript. Gridview looks really nice on the web page, but when I try to print out the gridview, it gets squished. I can even see the outline of squished gridview. Below is the image of the gridview in the print out:

enter image description here

as you can see the outline of the gridview after $14.00. the lighter outline after $14.00 is the entire gridview, but in printout, it got squished. Below is the code for the printout:

<script>

        function printContent(el) {
               var restorepage = $('body').html();
               document.getElementById('<%=lblDateTime.ClientID %>').style.display = "block";
               document.getElementById('<%=lblDateTime.ClientID %>').innerHTML = 'Current Date Time: ' + new Date().toLocaleString();
       
               document.getElementById('<%=acrLogo.ClientID %>').style.display = "block";
               document.getElementById('<%=compName.ClientID %>').style.display = "block";
               var printcontent = $('#' + el).clone();
                printcontent.removeAttr('style');
               $('body').empty().attr('style', 'background-color: white;').html(printcontent);
                $('body').empty().html(printcontent);
                window.print();
                $('body').html(restorepage);
            }

</script>

How can I expand the gridview all the way to the line so that it doesn't get squished in the print out. below is the code of the gridview:

                              <div class="container">
                                  <div class="row justify-content-center">
                                    <div class="col-sm-6">
                                        <asp:GridView ID="grdCalculate" runat="server" GridLines="Horizontal" CssClass="table table-responsive table-hover table-striped table-bordered table-condensed" OnRowDataBound="grdCalculate_RowDataBound">
                                        </asp:GridView>
                                    </div>
                                </div>
                            </div>   

any help will be aprpeciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!