473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Printing tables

The W3C added THEAD, TFOOT and TBODY elements to facilitate the
printing of long tables, so that header and footer information could
be repeated on each page.

While I have seen this discussed briefly in a number of text books, I
have never seen it applied in reality satisfactorily.

Can anyone point me to a real situation where this has been done
please? I have tried in vain to find examples, but have been deluged
with irrelevant information so that I can't see the wood for the
trees!

Does anyone know of limitations? Very many thanks.
Dec 26 '07 #1
7 2402
On 12/26/2007 9:48 AM, jo********@gmail.com wrote:
The W3C added THEAD, TFOOT and TBODY elements to facilitate the
printing of long tables, so that header and footer information could
be repeated on each page.

While I have seen this discussed briefly in a number of text books, I
have never seen it applied in reality satisfactorily.

Can anyone point me to a real situation where this has been done
please? I have tried in vain to find examples, but have been deluged
with irrelevant information so that I can't see the wood for the
trees!

Does anyone know of limitations? Very many thanks.
In Gecko browsers (e.g., Firefox, SeaMonkey, Camino), there is a
well-known bug that prevents proper printing of long tables. See
<https://bugzilla.mozilla.org/show_bug.cgi?id=294991>. Despite the
Summary, this also appears to affect tables without captions.

--
David E. Ross
<http://www.rossde.com/>

Natural foods can be harmful: Look at all the
people who die of natural causes.
Dec 26 '07 #2
David E. Ross wrote:
On 12/26/2007 9:48 AM, jo********@gmail.com wrote:
>The W3C added THEAD, TFOOT and TBODY elements to facilitate the
printing of long tables, so that header and footer information could
be repeated on each page.

While I have seen this discussed briefly in a number of text books, I
have never seen it applied in reality satisfactorily.

Can anyone point me to a real situation where this has been done
please? I have tried in vain to find examples, but have been deluged
with irrelevant information so that I can't see the wood for the
trees!

Does anyone know of limitations? Very many thanks.

In Gecko browsers (e.g., Firefox, SeaMonkey, Camino), there is a
well-known bug that prevents proper printing of long tables. See
<https://bugzilla.mozilla.org/show_bug.cgi?id=294991>. Despite the
Summary, this also appears to affect tables without captions.
I was surprised by this item dated 2005-06-19:

The problem seems to be that we reflow the
inner table, *then* we reflow and place the
caption, which moves the inner table down.
The inner table no longer fits on the page
so bad things happen.

It looks like we want to reflow the table
first to find the table width before we reflow
the caption, but we need to reflow the
caption first so we know the available height
... I'm not sure how to resolve this
circularity. Any ideas

I don't see any circularity. Once computed, the table width should
remain the same and apply to every part of the table no matter how many
pages it covers. After that, the height of the caption can be
determined, and now the only thing that that affects is the choice of a
subset of rows to print on each page. Am I missing one or more
considerations?
Dec 26 '07 #3
On 2007-12-26, Harlan Messinger <hm*******************@comcast.netwrote:
David E. Ross wrote:
[...]
>In Gecko browsers (e.g., Firefox, SeaMonkey, Camino), there is a
well-known bug that prevents proper printing of long tables. See
<https://bugzilla.mozilla.org/show_bug.cgi?id=294991>. Despite the
Summary, this also appears to affect tables without captions.

I was surprised by this item dated 2005-06-19:

The problem seems to be that we reflow the
inner table, *then* we reflow and place the
caption, which moves the inner table down.
The inner table no longer fits on the page
so bad things happen.

It looks like we want to reflow the table
first to find the table width before we reflow
the caption, but we need to reflow the
caption first so we know the available height
... I'm not sure how to resolve this
circularity. Any ideas

I don't see any circularity. Once computed, the table width should
remain the same and apply to every part of the table no matter how many
pages it covers. After that, the height of the caption can be
determined, and now the only thing that that affects is the choice of a
subset of rows to print on each page. Am I missing one or more
considerations?
No I don't think so.

It may be that the Gecko code only computes the width of a table as a
side-effect of reflowing it, so it's a hassle to re-organize, but there
is no real circularity that I can see: the width of the table doesn't
depend on the height of the caption.
Dec 26 '07 #4
Wed, 26 Dec 2007 17:24:54 -0600 from Ben C <sp******@spam.eggs>:
It may be that the Gecko code only computes the width of a table as a
side-effect of reflowing it, so it's a hassle to re-organize, but there
is no real circularity that I can see: the width of the table doesn't
depend on the height of the caption.
And the bug occurs even when there's no caption. I have this problem
with pretty nearly every table that crosses a page boundary, and I
use captions rarely or never.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Dec 27 '07 #5
Harlan Messinger wrote:
David E. Ross wrote:
>On 12/26/2007 9:48 AM, jo********@gmail.com wrote:
>>The W3C added THEAD, TFOOT and TBODY elements to facilitate the
printing of long tables, so that header and footer information could
be repeated on each page.

While I have seen this discussed briefly in a number of text books, I
have never seen it applied in reality satisfactorily.

Can anyone point me to a real situation where this has been done
please? I have tried in vain to find examples, but have been deluged
with irrelevant information so that I can't see the wood for the
trees!

Does anyone know of limitations? Very many thanks.

In Gecko browsers (e.g., Firefox, SeaMonkey, Camino), there is a
well-known bug that prevents proper printing of long tables. See
<https://bugzilla.mozilla.org/show_bug.cgi?id=294991>. Despite the
Summary, this also appears to affect tables without captions.

I was surprised by this item dated 2005-06-19:

The problem seems to be that we reflow the
inner table, *then* we reflow and place the
caption, which moves the inner table down.
The inner table no longer fits on the page
so bad things happen.

It looks like we want to reflow the table
first to find the table width before we reflow
the caption, but we need to reflow the
caption first so we know the available height
... I'm not sure how to resolve this
circularity. Any ideas

I don't see any circularity. Once computed, the table width should
remain the same and apply to every part of the table no matter how many
pages it covers. After that, the height of the caption can be
determined, and now the only thing that that affects is the choice of a
subset of rows to print on each page. Am I missing one or more
considerations?
If there are any floats beside the table, I can see how the *height* of
the rows might need to be recomputed as some of the ones whose text
would have wrapped at the floated element will have been pushed down
beneath it. But that's easy--there still isn't any circularity involved.
Dec 27 '07 #6
On 2007-12-27, Harlan Messinger <hm*******************@comcast.netwrote:
Harlan Messinger wrote:
>David E. Ross wrote:
[...]
>>>
In Gecko browsers (e.g., Firefox, SeaMonkey, Camino), there is a
well-known bug that prevents proper printing of long tables. See
<https://bugzilla.mozilla.org/show_bug.cgi?id=294991>. Despite the
Summary, this also appears to affect tables without captions.

I was surprised by this item dated 2005-06-19:

The problem seems to be that we reflow the
inner table, *then* we reflow and place the
caption, which moves the inner table down.
The inner table no longer fits on the page
so bad things happen.

It looks like we want to reflow the table
first to find the table width before we reflow
the caption, but we need to reflow the
caption first so we know the available height
... I'm not sure how to resolve this
circularity. Any ideas

I don't see any circularity. Once computed, the table width should
remain the same and apply to every part of the table no matter how many
pages it covers. After that, the height of the caption can be
determined, and now the only thing that that affects is the choice of a
subset of rows to print on each page. Am I missing one or more
considerations?

If there are any floats beside the table, I can see how the *height* of
the rows might need to be recomputed as some of the ones whose text
would have wrapped at the floated element will have been pushed down
beneath it.
What I think you're describing can't happen. You can't have text inside
a table cell flowing around a float that originates outside the table
cell (including outside the table). This is because table cells are
"block formatting contexts"-- which means floats never leak into or out
of them.

The whole table itself may become narrower if there's a float to one
side of it though, and the presence of the caption may mean it clears
the float, and can be wider after all. So there is an additional
complexity there, but as you say, not a circularity.

But I think all this may be a red herring anyway, since the
table-breaking bug seems to occur even when there isn't a caption.
Dec 27 '07 #7
On 2007-12-27, Harlan Messinger <hm*******************@comcast.netwrote:
Ben C wrote:
>On 2007-12-27, Harlan Messinger <hm*******************@comcast.netwrote:
[...]
>>If there are any floats beside the table, I can see how the *height* of
the rows might need to be recomputed as some of the ones whose text
would have wrapped at the floated element will have been pushed down
beneath it.

What I think you're describing can't happen. You can't have text inside
a table cell flowing around a float that originates outside the table
cell (including outside the table). This is because table cells are
"block formatting contexts"-- which means floats never leak into or out
of them.

I'm not sure how that follows. A div is a block formatting context,
No, not just any div. Only one that's overflow: anything-except-visible,
floated, display: inline-block or table-cell, etc. (see CSS 2.1 9.4.1) A
regular div is a block box, but not necessarily, and often not, a block
formatting context.
and the text within a div will certainly flow around a floated element
that precedes the div.
Yes, but only if the floated element is in the same block formatting
context as the div. Not in the same block box-- floats often leak out of
one block box into another and inline content has to flow around them.
But they don't cross the "city walls" of block formatting contexts.
I just ran a test with a p styled float: right and width: 10em followed
by a table styled width: 100% and three rows containing five columns of
text each, and found that that IE6 puts the whole table underneath the
paragraph and then gives it the width of the browser, while Firefox 2
ignores the paragraph completely when positioning and layout the the
table, also giving the table the full width of the browser, but also
overlapping the paragraph in full. My FTP server is refusing my
connection right now so I can't upload my test file for inspection but
it's below for anyone who wants to look.
CSS 2.1 9.5 says:

The margin box of a table, a block-level replaced element, or an
element in the normal flow that establishes a new block formatting
context [p. 126] (such as an element with 'overflow' other than
'visible') must not overlap any floats in the same block formatting
context as the element itself. If necessary, implementations should
clear the said element by placing it below any preceding floats, but
may place it adjacent to such floats if there is sufficient space.

Firefox is wrong here, and IE6 right. The table ought to go below the
float if you've set it to width: 100%.

But the one thing you will never see is inline boxes inside the table
cells flowing around that float since it originates outside the table
cells and therefore in a different BFC.
Dec 27 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Karl E. Taylor | last post by:
Could someone point me in the direction of a good example of coding report printing from database tables through VB? I have 5 tables that I need to run a report from. They are actually very...
7
by: Dennis C. Drumm | last post by:
I was wondering if someone could suggest were/how I could get started with setting up printing of a collection of text that includes tables from a grid and other supporting information about the...
1
by: Smitha Nataraj | last post by:
Hello, Please let me know if you have the solution for a similar kind of problem... Background: I have an aspx page which is used as a report i.e. will be used for printing some information....
8
by: CJM | last post by:
What is the best way to force a page break when printing from a browser? A page in my application generates a series of tables which are usually less than will fit on a page of A4. Ideally I want...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
1
by: popwhub | last post by:
I am having problems printing some reports from my application that are generated from temporary tables. The application has an Access FE and a SQL Server BE. The current method uses a temporary...
2
by: coldblood22 | last post by:
Well in my Application i am using the java Printable interface to print the GUI. The printing is done fine but once done with the printing my program breaks off with the database file without. Well...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
1
by: Glenn | last post by:
I am writing a program for field work that will use a receipt printer. I need to be able to adjust the page settings prior to printing depending on how much needs to be printed. I have been able...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.