CSS and Printing

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.
DidiTry placing a header, footer and body in your table:

<table>
<thead>
<th id="foo">Header Cell</th>
</thead>
<tfoot>
<th>Footer Cell</th>
<tfoot>
<tbody>
<td headers="foo">Data Cell</td>
</tbody>
</table>

Then add the necessary CSS. The table header and footer should show up on the tops and bottoms of every printed page.HI

Thanks for the reply

But it does not work....

Any thoughts please...I was trying to use the print media css as well, and the reading up I did boiled down basically to bad news -- present browsers do not support it at all well, if at all.

I put some of it in my pages, but experience is confirming browser lack of support -- nothing is happening based on the css "bage-break-xxxx" definitions.
 
Back
Top