0

hope all will be fine...

i want to print a page by using php.... but not getting any solution... plz help me...

table width=800px and height=700px ....

when i use the java script print function {window.print()}

it print the whole page.....
including the URL text(i-e: http://localhost/ebooks/print_page.php)...

but i want to print that specific(area) table.... only 800width and 700height ..

how to do this job... em stuck ...

please check the attach image ... i want only that black border and its contents which are inside the black border.....

Attachments dmc.jpg 23.88 KB
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by paulrajj
0

Hi,

Check out the below javascript print div part.

<a href="javascript:void(0)" onclick="PrintContent()">Print</a>
       <div id="prints">
	Your specific table goes here...
	</div>
	<script type="text/javascript">
	function PrintContent()
	{
		var DocumentContainer = document.getElementById('prints');
		var WindowObject = window.open('', "PrintWindow", "width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes");
		WindowObject.document.writeln(DocumentContainer.innerHTML);
		WindowObject.document.close();
		WindowObject.focus();
		WindowObject.print();
		WindowObject.close();
	}
	</script>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.