Click to See Complete Forum and Search --> : Formatting HTML tables to print nicely with CSS.


albertacoder
05-23-2003, 12:48 PM
Greetings,

I have developed a stand alone app that
gathers information from a DB, and generates
the corresponding XML representation.

Once I have the XML I transform it to HTML
with XSL, and launch it in IE6.

The trouble is that much of my data is
represented with large HTML tables. When
I try to print these tables I get very ugly
page breaks.

Would it be possible to use CSS to ensure
that the printed output is formatted nicely?

Thanks in advance.

Ryan

pyro
05-23-2003, 01:15 PM
Yes, you can specify where and when a page should break: http://www.w3.org/TR/2002/WD-CSS21-20020802/page.html

Charles
05-23-2003, 01:22 PM
What I do in that situation, is I use XSL to transform the XML into Formatting Objects (FO) and then I use Apache's FOP (http://xml.apache.org/fop/) to generate a printer friendly, PDF version. Once you get the hang of structuring the document, FO syntax and grammer is just an XML version of CSS.