Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8273661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:32:32+00:00 2026-06-08T07:32:32+00:00

I have a table in a PHP page. It is a invoice. So I

  • 0

I have a table in a PHP page. It is a invoice.
So I want to print it after adding items to it,
and I had already done the coding part and all the things are working properly.

Now I just want to print that invoice table to a paper
by pressing a button. I searched on Google but no clue is found to do that.

Can any one help me?

This is my table on right hand side. It is populated by the form in left hand side
so I just want to print that right hand side table:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:32:34+00:00Added an answer on June 8, 2026 at 7:32 am

    Try this one:

    Add an attribute id to your table your_content

    Place an anchor tag :

       <a href="javascript:void(0);" id="printPage">Print</a> 
    

    And add script:

    This script will initially show print preview of the content that is inside your table.

     <script lang='javascript'>
     $(document).ready(function(){
      $('#printPage').click(function(){
            var data = '<input type="button" value="Print this page" onClick="window.print()">';           
            data += '<div id="div_print">';
            data += $('#your_content').html();
            data += '</div>';
    
            myWindow=window.open('','','width=200,height=100');
            myWindow.innerWidth = screen.width;
            myWindow.innerHeight = screen.height;
            myWindow.screenX = 0;
            myWindow.screenY = 0;
            myWindow.document.write(data);
            myWindow.focus();
        });
     });
    

    Copy the script part and put it on the top of your page. And put the print link, [above anchor tag] wherever you want. And make sure you have included the jquery script file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table FOLDERS ,everytime a folder is added through a php page
When showing data from a mysql table on an php page does it have
I have web page in PHP which displays all records in a table. I
I have a php table and i want the ability to delete rows of
I have a table generated by PHP/mysql, I want a user to click the
I have a problem with sorting items in table in PHP. Here is what
I have a PHP page, which builds up a table in the php code,
I have a two column (table based) PHP generated HTML page. I need to
I have two different queries in my php page for the same table, the
I have a table of data from mysql rendered on page via PHP into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.