dd1313
07-14-2005, 01:38 PM
Hello Friends
I am having a tough time formatting my print job using CSS.
my situation is like this:-
I am producing a page dynamically using PHP from a mysql database.The data
is displayed like this
<table border ="1">
then I loop through using PHP to display data below
<tr><td>Heading 1</td><td>Heading 2</td><td>Heading 3</td></tr>
<tr><td>data from DB relating to heading 1</td><td>data from DB relating to heading 2</td><td>data from DB relating to heading 3</td></tr>
after all the data is displayed I close the table
</table>
My challenge is that I need to produce a printable report of this information as well but I need to make sure that the information produces page breaks on the printatble pages where necesary.So I am using
page-break-before:
page-break-after:
page-break-inside:
but the desired result is not beaing produced.Basically I need the following
1.Each page must have a border, but at the moment only the first page on top and the last page at the bottom have a border , the rest only have the left and right borders of the table.
2. I need to make sure that if there is not enough space at the bottom of the page then either the heading row or the data row will not print on that page but do a page break first.
I have been trying with page-break but I don't know where to put it,
Please guiide me.
Didi
I am having a tough time formatting my print job using CSS.
my situation is like this:-
I am producing a page dynamically using PHP from a mysql database.The data
is displayed like this
<table border ="1">
then I loop through using PHP to display data below
<tr><td>Heading 1</td><td>Heading 2</td><td>Heading 3</td></tr>
<tr><td>data from DB relating to heading 1</td><td>data from DB relating to heading 2</td><td>data from DB relating to heading 3</td></tr>
after all the data is displayed I close the table
</table>
My challenge is that I need to produce a printable report of this information as well but I need to make sure that the information produces page breaks on the printatble pages where necesary.So I am using
page-break-before:
page-break-after:
page-break-inside:
but the desired result is not beaing produced.Basically I need the following
1.Each page must have a border, but at the moment only the first page on top and the last page at the bottom have a border , the rest only have the left and right borders of the table.
2. I need to make sure that if there is not enough space at the bottom of the page then either the heading row or the data row will not print on that page but do a page break first.
I have been trying with page-break but I don't know where to put it,
Please guiide me.
Didi