function PrintPage() {
document.getElementById('print').style.display = 'none';
window.resizeTo(960, 600);
document.URL = "";
window.location.href = "";
window.print();
}

@page { size: auto; margin: 2mm 4mm 0mm 0mm; }
.theadclass{top:0;position:fixed;display:block;height:100px;width:100%;border:solid 2px red;background-color:red;overflow:hidden;z-index:1;clear:both}.tfootclass{bottom:0;position:fixed;display:block;height:100px;clear:both;width:100%;border:solid 2px red;overflow:hidden;background-color:#000}

<form id="form1" runat="server">
<br clear="all"/>
<input type="button" id="print" name="print" value="Print" onclick="javascript:PrintPage();" class="button" />
<div class="theadclass"> header content here</div>
<div class="tbodyclass">
<?php
for ($i=0; $i < 150; $i++) {
echo "".$i."<br/>";
}
?>
</div>
<div class="tfootclass"> footer content here </div>
</form>
&#13;