claro Posted October 22, 2011 Share Posted October 22, 2011 Hi there, I'm new in PHP, my output is in at table, I designed it already, now I want to print it..how can I do that ? do i need JS ? Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/ Share on other sites More sharing options...
amg182 Posted October 22, 2011 Share Posted October 22, 2011 Need much more info... are you referring to a mysql database table? Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281370 Share on other sites More sharing options...
claro Posted October 22, 2011 Author Share Posted October 22, 2011 Nope, in my html page itself..I want to print the rows, columns and headings .I don't have any idea about it. Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281384 Share on other sites More sharing options...
possien Posted October 23, 2011 Share Posted October 23, 2011 You can use this. If you only want to print certain elements you can use styling for printing. You can view everything but will only print certain things. Neither are part of PHP <form><input type="button" value=" Print this page " onclick="window.print();return false;" /></form> Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281478 Share on other sites More sharing options...
claro Posted October 23, 2011 Author Share Posted October 23, 2011 Ok, I got It. What if I want to view first before printing, I'm talking about the print preview? thanks for your response .. Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281480 Share on other sites More sharing options...
watsmyname Posted October 23, 2011 Share Posted October 23, 2011 Ok, I got It. What if I want to view first before printing, I'm talking about the print preview? thanks for your response .. I dont think you can use javascript or a good way to call a browser's print preview feature. Instead you can pop up a new window to display your tables and use media type screen, print in the stylesheet you include in this window. Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281481 Share on other sites More sharing options...
claro Posted October 23, 2011 Author Share Posted October 23, 2011 ahh..I see, I think its better than nothing, I will do it..how is it done? Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281484 Share on other sites More sharing options...
watsmyname Posted October 23, 2011 Share Posted October 23, 2011 Just load a tables in new popup window, create a new stylesheet for media screen, print [you can google them], and load this stylesheet in this page. You can go through this article for a help Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281485 Share on other sites More sharing options...
claro Posted October 23, 2011 Author Share Posted October 23, 2011 many thanks! Quote Link to comment https://forums.phpfreaks.com/topic/249583-printing-php/#findComment-1281487 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.