473,569 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page breaks in tables

Firefox 3 (like older versions) ignores

TR { page-break-before: always }

for the first row of a TBODY. Sample page:

http://www.unics.uni-hannover.de/nht...temp/1000.html
Choose "Print Preview".

Internet Explorer 6/7 prints every row onto a new page;
Firefox does not. Is this an obscure bug? Or is FF right?

Btw:
IE 6/7 ignores page breaks with TBODY altogether.

--
Bugs in Internet Explorer 7
http://freenet-homepage.de/prilop/ie7-bugs.html
Aug 29 '08 #1
5 5431
Andreas Prilop wrote:
Firefox 3 (like older versions) ignores

TR { page-break-before: always }

for the first row of a TBODY. Sample page:

http://www.unics.uni-hannover.de/nht...temp/1000.html
Choose "Print Preview".

Internet Explorer 6/7 prints every row onto a new page;
Firefox does not. Is this an obscure bug? Or is FF right?
CSS 2.1 states that only block-level elements (which TR is not) must
support page-break, while other elements (table rows are an example) may
support it. So I'll go off of CSS 3's draft here
(<http://dev.w3.org/csswg/css3-page/>).

§9.4 says:
In the normal flow, page breaks may occur at the following places:

1. In the vertical margin between sibling block boxes (or rows in a
table). When a page break occurs here, the used values of the adjoining
‘margin-bottom’ and ‘margin-top’ properties are set to ‘0’.
2. Between line boxes inside a block box.

A table row is not a block box, so that means that the page breaks are
allowed there only by the parenthetical. Since before the first row is
not between rows, the page break is technically not allowed there.

The distinction is a fine one, however, and it might warrant opening up
an issue on the W3C CSS mailing list.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Aug 29 '08 #2
Fri, 29 Aug 2008 11:32:45 -0400 from Joshua Cranmer <Pidgeot18
@verizon.invali d>:
CSS 2.1 states that only block-level elements (which TR is not) must
support page-break, while other elements (table rows are an example) may
support it. So I'll go off of CSS 3's draft here
(<http://dev.w3.org/csswg/css3-page/>).
Que? If table rows are not identical to TR, then what are they?

--
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
Aug 29 '08 #3
Stan Brown wrote:
Fri, 29 Aug 2008 11:32:45 -0400 from Joshua Cranmer <Pidgeot18
@verizon.invali d>:
>CSS 2.1 states that only block-level elements (which TR is not) must
support page-break, while other elements (table rows are an example) may
support it. So I'll go off of CSS 3's draft here
(<http://dev.w3.org/csswg/css3-page/>).

Que? If table rows are not identical to TR, then what are they?
Let me explain it more clearly.

CSS 2.1 only explicitly requires that page-break be supported by
block-level elements. It also permits implementors to support other
elements, citing table rows (i.e., TR) explicitly.

So I never meant to imply a distinction between the two. Apologies if it
sounded otherwise.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Aug 29 '08 #4
Joshua Cranmer wrote:
CSS 2.1 only explicitly requires that page-break be supported by
block-level elements. It also permits implementors to support other
elements, citing table rows (i.e., TR) explicitly.

So I never meant to imply a distinction between the two. Apologies if
it sounded otherwise.
But there _is_ a distinction between the two, even though it is mainly
conceptual and not that much practical.

The current excuse for a surrogate for an imitation of a standard for CSS,
namely the draft CSS 2.1 specification - which shall be cited as work in
progress only - says about page-break properties the following, among other
things:

"User Agents must apply these properties to block-level elements in the
normal flow of the root element. User agents may also apply these properties
to other elements, e.g., 'table-row' elements."

So what it mentions, as an example of other types of elements, apparently
means an element for which the display property has the value table-row.
This is at a conceptual level quite distinct from specific HTML elements.
Although a TR element can be expected to have display: table-row by default,
and this is suggested in the sample style sheet for HTML too, there is no
_requirement_ on this. In fact, IE does not even support display: table-row
but it still implements TR elements as rows of tables in the intuitive
sense.

Specifically, you can set the display value of TR to something else than
table-row, or set display: table-row for some other element - and at least
the latter may make perfect sense, especially when you are actually styling
XML and not HTML. This is way over the head of IE of course, but it's still
how things should work, and do work on supporting browsers.

Technically, if you set tr { display: block; }, then conforming browsers are
required to apply page-break properties. But this is not a good idea because
it may seriously break table formatting.

This gives me an idea... instead of setting page-break properties for a TR
element, why not put an auxiliary block element inside the first cell and
assign such a property to it. Compare:

<table>
<tr><td>first row</td></td></tr>
<tr class="foo"><td >second row</td></td></tr>
</table>

<table>
<tr><td>first row</td></td></tr>
<tr><td><div class="foo">sec ond row</div></td></td></tr>
</table>

Now if I set
.foo { page-break-before: always; }
then the second row of the first table _may_ appear at the start of a new
page, whereas the second row of the second table _must_ appear at the start
of a new page, on browsers playing by CSS 2.1 rules.

I'm not really surprised at seeing that this little trick, though apparently
it should work according to the "standard", fails miserably: on Firefox 3,
the behavior is just the opposite - setting page-break property on TR _is_
honored, setting it on a block element (inside TD) is ignored.

So much for "standards-compliance".

Yucca

Aug 30 '08 #5
On 30 Aug, 11:50, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
IE does not even support display: table-row
Can you please clarify what you mean by this?

"IE does not (correctly|full y)? support the behaviour specified for
display: table-row on anything including <tr>"

or

"IE only supports the behaviour for display: table-row for the HTML
element <trand nothing else. It is not selectable by specifying
display: table-row through CSS for any other element."
Sep 1 '08 #6

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

Similar topics

1
2732
by: Joseph Ferris | last post by:
Hello, I am having an issue with page breaking that I hope someone will be able to help me with. Still a relative "newbie", and I thought this might be a good place to find some help. I have a complex FO that contains nested tables. There are a few places where my breaks are not being rendered, although other ones work fine. I've made...
4
2865
by: Ben | last post by:
I have a page for my company that I need assistance with: http://www.eastex.net/ben/NewETN/subPage.htm When you resize the window (NS or IE) small enough that you have to scroll horizontally (because of logo image), scrolling right breaks the layout. I'm using 100% div widths, and these apparently don't reset when scrolling. I tried using...
0
1276
by: Dude | last post by:
I am using new_range.InsertAfter txt new_range.ConvertToTable vbTab new_range.InsertBreak new_range.InsertAfter txt2 new_range.ConvertToTable vbTab new_range.InsertBreak
2
2617
by: tomh | last post by:
I have a repeater which displays records from a database in table form. Each record is placed in its own table of about 3 columns and ten rows. This website is intended to be printed and prints out to about 10 pages, although there are page breaks in the middle of some of the tables, causes the data to be split up. Using a repeater I cannot...
4
3636
by: Ed Jay | last post by:
I generate a DHTML page (a medical report) with dynamically generated text based on user input (answers to questions). The page length changes dynamically. I desire that when the page is printed and reaches a specific length, it terminates printing that page, prints a page number, and then begins to print the next page using the same header...
16
8364
by: matt | last post by:
hello, ive been trying to figure something out, largely thru trial & error. thought perhaps someone else may have knowledge. i have an html table that consists of blocks of related data -- each block contains three rows. this table is destined for paper printing. i would like to tell the browser *not* to bust up my blocks. rather, i...
0
1328
by: bblue | last post by:
hi, I need help in implementing page breaks in XML files? any suggestion on how can this be done? do you recommend using processing instructions or add a new elements would make more sense? can the processing instruction page number help in my case? To clarify things up, I know the content is displayed after being rendered to some XMLObjects...
2
1562
by: Taftheman | last post by:
Hi, i have a problem forceing page breaks in word via a vb6 application i have the following code but it does not seem to like it , can any body help .Tables(1).Split.AllowPageBreaks = True
4
1252
pradeepjain
by: pradeepjain | last post by:
I have 10-11 tables in an html page .I need to take a print out of this page .but few tables half part comes in next page . is there a way to give a page break so that i can limit number of entries in one page .say 2 per page .
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.