• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing with DIV tags

 
M Suguna
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have the follwing HTML page.

This code produces a table with 4 rows. Only a part of the table will be visible (say, 2 rows) and the user has to use the scroll bar to view the remaining part of the table.
There is also a Print button in the page which calls window.print()
The problem is, window.print() prints only the visible part of the table (the top 2 rows). I want to print the entire table, when the print button is pressed.
Is there a way to achieve this?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what you will need to do is make the table bigger when the button for print is pushed.... Here is an example I just wrote up. I did not test it in Netscape,,,,only IE
<script>
function ChangeIt(){
wlayer="ViewTable";
if (document.getElementById) {document.getElementById(wlayer).style.height=200;}
else if (document.all) {document.all[wlayer].style.height=200;;}
else if (document.layers) {document.layers[wlayer].height=200;}
}
</script>
<table id="ViewTable" style="height:50" border='1'>
<tr><td><form>
<input type="button" on_click="ChangeIt()" name="butt" value="Make Bigger">
</form></td></tr>
</table>

Remeber to change on_click
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic