how to create nice HTML tables in reports?

Bill Gribble grib@gnumatic.com
Mon, 22 Jan 2001 09:30:41 -0600


On Sun, Jan 21, 2001 at 01:59:16AM -0800, Christian Stimming wrote:
> I would like to (re)write a profit-and-loss report, probably in the next 
> week or so because I need it. But I am unsure on how to achieve a nice 
> looking hierachical account list for the report. 

Have you looked at the account summary report in the development
version?  That's one approach.  It's not perfect but I don't mind it.
The other approach as you pointed out is to use colspan creatively if
you know the depth of the account tree.

> (This makes the assumption that the cell borders are set to zero,
> i.e. <table border=0>, an assumption that I think is reasonable for
> any report that is to be printed.) 

Actually, no.  In the development version, many parameters of how the
report is rendered can be changed by the user via 'style sheets'.  The
default "Plain" style sheet for all reports has as its editable
parameters the border, padding, and cellspacing to be used for all
tables rendered in the report.

You can override that; for example, the "Fancy" style sheet template
in the development source tree is based on a table which overrides the
border to 0 regardless of what the style sheet says.  However, since
reports are going to be used in other places besides their own window
(printing, embedded in the main window, etc) it's important for the
report to be "hands off" about this stuff, letting the user (via the
style sheet) specify the appearance of the report.  This allows the
report to be used in a lot of different contexts and still look good.

I know the table formatting options are limited in gtkhtml's HTML 3
implementation.  To the extent that we can hack around its limitations
to make things look good, please keep in touch with me, so the time
you spend improving table rendering can go into the <html-table> code
and improve everybody's tables, not just one report.

b.g.