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.....

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>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.