page break vs footer while printing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
silenceghost
Forum Newbie
Posts: 22
Joined: Sun Oct 19, 2008 3:25 am

page break vs footer while printing

Post by silenceghost »

I need some information about the page break
I have one html table which is of displaying like footer where some kind of information is shown
when i now click the print button is there any way to include the html table content before the page break start.
EG.
->Header
->dynamically generated report.
->footer before the page break(footer to display ID and date information on each page printed)

I have done but no use which is a part of include footer.php

Code: Select all

 
<DIV style="page-break-before:always">
    <table>
        <tr>
            <td width="93"><strong>Request ID:</strong></td>
            <td width="32">&nbsp;<?=$data['REQUEST_ID']?></td>
        </tr>
        <tr>
            <td><strong>Request Date</strong></td>
            <td>&nbsp;<?=$data['REP_DT']?></td>
        </tr>
    </table>
</DIV>
 
silenceghost
Forum Newbie
Posts: 22
Joined: Sun Oct 19, 2008 3:25 am

Re: page break vs footer while printing

Post by silenceghost »

I have searched through various sites and come up for the solution through css which solved my problem

Code: Select all

 
<style>
@media print {
    input {
        display: none;
    }
    button {
        display: none;
    }
 
    div#footer {
        display: block; position: fixed; bottom: 0;
    }
}
<style>
 
 <DIV id="footer">
     <table>
         <tr>
             <td width="93"><strong>Request ID:</strong></td>
             <td width="32">&nbsp;<?=$data['REQUEST_ID']?></td>
         </tr>
         <tr>
             <td><strong>Request Date</strong></td>
             <td>&nbsp;<?=$data['REP_DT']?></td>
         </tr>
     </table>
 </DIV>
 
Post Reply