hi all,

thanx for all your suggestions. however, the css below doesn't seem to help
me solve my <tfoot> problem. if my <tbody> is pretty short, the <tfoot> will
still NOT appear at the bottom of my page but it appears where my <tbody>
ends (which sometimes ends in the middle of my page). what else can i do??

by the way, i cannot use PDFs to generate my reports as suggested by many of
you kind souls. This is because my clients just want to click on the "Print
Monthly Report" button and i am suppose to fetch the relevant data from
MySQL DB and print out the report.. they don't need to save them in Excel or
PDF. It is restricted to printing off the IE browser.

The problem that gives me the most headache is how can I know the total
number of pages and the current page number, by using PHP?? I really need
this because a report can be hundreds of pages so page number is very
important to my clients.

Please kindly help me! thank you soooo much!

Hwee

----- Original Message ----- 
From: "Neil Smith [MVP, Digital media]" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 31, 2005 9:15 PM
Subject: Subject: Web Printing


> At 10:27 31/03/2005 +0000, you wrote:
> >Message-ID: <[EMAIL PROTECTED]>
> >From: "Ng Hwee Hwee" <[EMAIL PROTECTED]>
> >To: "PHP DB List" <php-db@lists.php.net>
> >Date: Thu, 31 Mar 2005 18:24:41 +0800
> >Subject: Web Printing
> >
> >Hi all,
> >
> >i know i can print out a header and footer using HTML <thead> and
<tfoot>.
> >However, the <tfoot> doesn't always stay at the bottom of the page. For
> >example, if the the last page only have 2 records, the <tfoot> will
appear
> >pretty high on the page.
> >
> >i am wondering how can i use PHP to fix the position of my header and
footer
>
> PHP cannot help you here, it's the wrong tool for the job (it's a "hammer"
> not a "screwdriver" so to speak).
> You need to (*must* !!!) use CSS to position and specify the height and
> dimensions of the thead and tfoot thus :
>
>
> thead {
>          display: table-header-group;
>          position: absolute;
>          top: 0;
>          height: 36pt;
>          width: 100%;
> }
>
> tfoot {
>          display: table-footer-group;
>          position: absolute;
>          bottom: 0;
>          height: 36pt;
>          width: 100%;
> }
>
> These should apply *reasonably* well to position your thead and tfoot row
> groups in the same place on each printed page (adjust as desired). You
> *cannot* use PHP to "guess" the height of the page areas reliably unless
> you are using a fixed pitch font such as a dot matrix line printer. And
> even then it's somewhat guesswork (I've done both).
>
> But if we're assuming that you're users have laser printers you *must* use
> CSS to do the print layout, PHP "line height guessing" will not work for
you.
>
> Cheers - Neil

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to