What you are proposing is possible to do in html, if you add some Cascading
Style Sheets to the mix.

You will need to use the page-break-after attribute:
http://www.w3.org/TR/CSS2/page.html#propdef-page-break-after

It would look something like this (in plain html):
<table style="page-break-after: always">
    <tr>
        <td>row1col1</td>
        <td>row1col2</td>
    </tr>
    <tr>
        <td>row2col1</td>
        <td>row2col2</td>
    </tr>
...
    <tr>
        <!--'N' represents the number of rows you wish to print before a
form-feed -->
        <td>rowNcol1</td>
        <td>rowNcol2</td>
    </tr>
</table>
<!--A printed page break would occur here-->

<table style="page-break-after: always">
<!--Wash, rinse, repeat-->

AFAIK, you'll have to close the table each time you want to print a line
feed, although if you want to keep your table together, you might try
putting the 'style="page-break-after: always"' attribute inside the
appropriate <tr> tag. No guarantees, tho, as I haven't tried it this way,
and it seems to go against the way CSS should work.

Also, not every browser supports these CSS attributes. You should be fine on
Netscape 6.0/Mozilla and IE 5 or better (not sure about IE, tho).

________________________________________
Nathaniel Price http://www.thornvalley.com
"Who is General Failure and why is he reading my hard drive?"

----- Original Message -----
From: "Jason S Motes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 8:15 AM
Subject: [PHP-DB] Re: sending a form feed to a printer


> form feeds don't work in html.  It is interpreted as a space.
>
> Arthur Chevalier wrote:
> > Hello,
> >
> > I am having problems getting the \f (form feed) expression to work.
After a
> > certain amount of lines print I want to start printing the next line on
a
> > new sheet of paper.  Any ideas of what I could be doing wrong.  Below is
a
> > sample piece of my code.  The bold code is where I am trying to issue
the
> > form feed.
> >
> > while($row = mysql_fetch_array($dbResult))
> > {
> > print("<TR>\n");
> > print("<TD class=\"tdborder\"><A
> > HREF=\"show_single_server.php?server_name=$row[0]\"
TARGET=\"text_float\">"
> > . $row[0] . "</TD>\n");
> > print("<TD class=\"tdborder\">". $row[1] . "</TD>\n");
> > print("<TD class=\"tdborder\">". $row[2] . "</TD>\n");
> > print("<TD class=\"tdborder\"><A
> > HREF=\"$PHP_SELF?mid_tier=$row[3]&db_rel=0\" TARGET=\"text_float\">".
> > $row[3] .  "</TD>\n");
> > print("<TD class=\"tdborder\"><A
> > HREF=\"$PHP_SELF?db_rel=$row[4]&mid_tier=0\" TARGET=\"text_float\">".
> > $row[4] .  "</TD>\n");
> >
> >           $rowdata = $row[5];
> >           if($rowdata == "")
> >           {
> >           print("<TD class=\"tdborder\">&nbsp;</TD>\n");
> >           }
> >           else
> >           {
> >           print("<TD class=\"tdborder\">". $row[5] .  "</TD>\n");
> >           }
> >           print("<TD class=\"tdborder\">". $row[6] .  "</TD>\n");
> >           //print("</TR>\n");
> >
> >           if($counter == "20")
> >             {
> >             $counter = "0";
> >             print("</TR>\f");
> >             continue;
> >             }
> >             else
> >             {
> >             $counter ++;
> >             print("</TR>");
> >             continue;
> >             }
> >
> > }
> >
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

Reply via email to