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

212
Views
Error indefinido al imprimir mi tabla HTML

Quería imprimir solo el contenido de mi tabla HTML dentro de la página web en la que estoy trabajando actualmente, sin embargo, cuando traté de imprimirlo, dice "indefinido". ¿Por qué es así? ¿Y hay alguna otra forma en que pueda imprimir mi tabla que está conectada en una base de datos? Aquí están mis códigos:

 <script> function printDiv(tableview) { var printContents = document.getElementsByClassName(tableview).innerHTML; var originalContents = document.body.innerHTML; document.body.innerHTML = printContents; window.print(); document.body.innerHTML = originalContents; } </script> <div class="printBtn"> <img src="images/printBtn_hover.png" class="printBtn_hover" onclick="printDiv('tableview')"> <img src="images/printBtn.png" class="printBtn" alt="print" onclick="printDiv('tableview')"> </div> <div class="tableview"> <table class="table"> <tr> <th class="theader">Entry Code</th> <th class="theader">User ID Number</th> <th class="theader">Name</th> <th class="theader">Date of Visit</th> <th class="theader">Time of Visit</th> </tr> <tbody> <?php while ($row = mysqli_fetch_array($searchResult)):?> <tr id="trow"> <td class="tdata"><?php echo $row['qr_id'];?></td> <td class="tdata"><?php echo $row['idNum'];?></td> <td class="tdata"><?php echo $row['lastName'].", ".$row['firstName']?></td> <td class="tdata"><?php echo $row['date'];?></td> <td class="tdata"><?php echo $row['time'];?></td> </tr> <?php endwhile; ?> </tbody> </table> </div>
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!