HighDots Forums  

<TBODY>, IE, and page-break

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss <TBODY>, IE, and page-break in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
matt@mailinator.com
 
Posts: n/a

Default <TBODY>, IE, and page-break - 09-19-2006 , 05:10 PM






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
would like it to smartly insert a page break inbetween <tbody>s if the
last one cannot be rendered entirely onto the remaining page area.

i have tried to accomplish this by styling the <tbody> w/
"page-break-before:auto;" -- hoping that it would automatically insert
a break before any <tbody> that cant fit on the page. sadly, this
doesnt work. im not sure what IE uses for its "auto" criteria, but it
doesnt appear to be "Does this element fit onto this page?"

ive also tried "page-break-after:auto", and both. no dice.

does any one have any other ideas?

thanks! and heres the html:


<table>
<thead>
<tr>
<th>header 1</th>
<th>header 2</th>
</tr>
<thead>
<tfoot>
<tr>
<td>footer 1</td>
<td>footer 2</td>
</tr>
<tfoot>

<!-- dont break this block -->
<tbody>
<tr>
<td>block 1, row 1</td>
<td>block 1, row 2</td>
</tr>
<tbody>

<!-- dont break this block -->
<tbody>
<tr>
<td>block 2, row 1</td>
<td>block 2, row 2</td>
</tr>
<tbody>

<!-- dont break this block -->
<tbody>
<tr>
<td>block 3, row 1</td>
<td>block 3, row 2</td>
</tr>
<tbody>

</table>


Reply With Quote
  #2  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-19-2006 , 05:33 PM






matt (AT) mailinator (DOT) com wrote:
Quote:
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
would like it to smartly insert a page break inbetween <tbody>s if the
last one cannot be rendered entirely onto the remaining page area.

i have tried to accomplish this by styling the <tbody> w/
"page-break-before:auto;" -- hoping that it would automatically insert
a break before any <tbody> that cant fit on the page. sadly, this
doesnt work. im not sure what IE uses for its "auto" criteria, but it
doesnt appear to be "Does this element fit onto this page?"

ive also tried "page-break-after:auto", and both. no dice.

does any one have any other ideas?

thanks! and heres the html:


table
thead
tr
th>header 1</th
th>header 2</th
/tr
thead
tfoot
tr
td>footer 1</td
td>footer 2</td
/tr
tfoot

!-- dont break this block --
tbody
tr
td>block 1, row 1</td
td>block 1, row 2</td
/tr
tbody

!-- dont break this block --
tbody
tr
td>block 2, row 1</td
td>block 2, row 2</td
/tr
tbody

!-- dont break this block --
tbody
tr
td>block 3, row 1</td
td>block 3, row 2</td
/tr
tbody

/table

Hard to say, if you used that markup is is so invalid...where to start.
Show a URL maybe your example here has typos (hopefully)

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #3  
Old   
matt@mailinator.com
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-19-2006 , 05:51 PM




Jonathan N. Little wrote:
Quote:
Hard to say, if you used that markup is is so invalid...where to start.
Show a URL maybe your example here has typos (hopefully)
perhaps, i just typed that in manually into google's UI (my real table
has too many un-related details). that isnt the important part. whats
important, is the technique used to solve the problem.

as for the sample table, i thought it pretty basic: a <thead>, a
<tfoot>, and one or more <tbody>s.


matt



Reply With Quote
  #4  
Old   
matt@mailinator.com
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-19-2006 , 06:07 PM



beauregard,

that wouldnt achieve anything. the <TBODY> tagset can be used in my
op's fashion (multiple instances) as a means of organizing sets of rows
into blocks (presumably of related data). my intent is to then style
those blocks such that they dont split apart onto multiple pages.

if i kept *all* the <TR> rows under the same <TBODY> roof, i have no
smaller units, only the single tbody. that especially wont do, since i
have 300 rows in total (3 in each <TBODY> -- far more than can fit onto
one page.


matt


Beauregard T. Shagnasty wrote:
Quote:
What happens if you combine the three rows into *one* <tbody> ?

!-- dont break this block --
tbody
tr
td>block 1, row 1</td> <-- these would be *cell* 1
td>block 1, row 2</td> <-- *cell* 2 ...
/tr
tr
td>block 2, row 1</td
td>block 2, row 2</td
/tr
tr
td>block 3, row 1</td
td>block 3, row 2</td
/tr
tbody


Reply With Quote
  #5  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-19-2006 , 06:19 PM



matt (AT) mailinator (DOT) com wrote:
TOP POSTING CORECTED

Quote:
Beauregard T. Shagnasty wrote:
What happens if you combine the three rows into *one* <tbody> ?

!-- dont break this block --
tbody
tr
td>block 1, row 1</td> <-- these would be *cell* 1
td>block 1, row 2</td> <-- *cell* 2 ...
/tr
tr
td>block 2, row 1</td
td>block 2, row 2</td
/tr
tr
td>block 3, row 1</td
td>block 3, row 2</td
/tr
tbody

that wouldnt achieve anything. the <TBODY> tagset can be used in my
op's fashion (multiple instances) as a means of organizing sets of rows
into blocks (presumably of related data). my intent is to then style
those blocks such that they dont split apart onto multiple pages.

if i kept *all* the <TR> rows under the same <TBODY> roof, i have no
smaller units, only the single tbody. that especially wont do, since i
have 300 rows in total (3 in each <TBODY> -- far more than can fit onto
one page.
Well it might help if you close them, I assume you *meant* to, else you
have 2 TBODYs together with one being empty.


STYLE:

TBODY { page-break-inside: avoid; }


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #6  
Old   
matt@mailinator.com
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-20-2006 , 10:53 AM




Beauregard T. Shagnasty wrote:
Quote:
Waiddaminnit. You said you had data in blocks of three rows. Yet you
illustrated three _single_rows_, each in a separate <tbody>.
so i did. glaring omission; i was pretty burnt out working on it last
nite.

updated HTML, but the problem is still the same as described -- IE 6
(win) inserts breaks directly into the <TBODY>s, even while using the
previously mentioned page-break instructions. this is confusing to me.
im not sure if IE is failing to "avoid" doing page breaks on my
<TBODY>s because A) its not supported, or B) because my attempts havent
been correct. (i dont have the HTML typos in my actual markup. they are
more complex tables which i reduced to simpler examples in google's
textbox for posting [no newsgroups fun at my org], probably in too much
of a hurry).


<table>
<thead>
<tr>
<th>header 1</th>
<th>header 2</th>
</tr>
<tr>
<th>header 3</th>
<th>header 4</th>
</tr>
<tr>
<th>header 5</th>
<th>header 6</th>
</tr>
</thead>
<tfoot>
<tr>
<td>footer 1</td>
<td>footer 2</td>
</tr>
</tfoot>

<!-- dont break this block -->
<tbody>
<tr>
<td>block 1, row 1, col 1</td>
<td>block 1, row 1, col 2</td>
</tr>
<tr>
<td>block 1, row 2, col 1</td>
<td>block 1, row 2, col 2</td>
</tr>
<tr>
<td>block 1, row 3, col 1</td>
<td>block 1, row 3, col 2</td>
</tr>
</tbody>

<!-- dont break this block -->
<tbody>
<tr>
<td>block 2, row 1, col 1</td>
<td>block 2, row 1, col 2</td>
</tr>
<tr>
<td>block 2, row 2, col 1</td>
<td>block 2, row 2, col 2</td>
</tr>
<tr>
<td>block 2, row 3, col 1</td>
<td>block 2, row 3, col 2</td>
</tr>
</tbody>

<!-- dont break this block -->
<tbody>
<tr>
<td>block 3, row 1, col 1</td>
<td>block 3, row 1, col 2</td>
</tr>
<tr>
<td>block 3, row 2, col 1</td>
<td>block 3, row 2, col 2</td>
</tr>
<tr>
<td>block 3, row 3, col 1</td>
<td>block 3, row 3, col 2</td>
</tr>
</tbody>
</table>


thanks,
matt



Reply With Quote
  #7  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-20-2006 , 12:59 PM



Beauregard T. Shagnasty wrote:
Quote:
In alt.html, matt (AT) mailinator (DOT) com wrote:

Beauregard T. Shagnasty wrote:
Waiddaminnit. You said you had data in blocks of three rows. Yet you
illustrated three _single_rows_, each in a separate <tbody>.
so i did. glaring omission; i was pretty burnt out working on it last
nite.

updated HTML, but the problem is still the same as described -- IE 6
(win) inserts breaks directly into the <TBODY>s, even while using the
previously mentioned page-break instructions. this is confusing to
me. im not sure if IE is failing to "avoid" doing page breaks on my
TBODY>s because A) its not supported, or B) because my attempts
havent been correct. (i dont have the HTML typos in my actual markup.
they are more complex tables which i reduced to simpler examples in
google's textbox for posting [no newsgroups fun at my org], probably
in too much of a hurry).

Tell us if this page I tossed together from your code - adding some text
to make it a meaningful length - is what you are attempting.

http://k75s.home.att.net/tbody.html

This works (page-break-after tbody) in Firefox, but not in IE or Opera.

The issue is with IE, so folks wonder why web developers b*tch about IE?

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #8  
Old   
matt@mailinator.com
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-20-2006 , 03:05 PM



Beauregard T. Shagnasty wrote:
Quote:
Tell us if this page I tossed together from your code - adding some text
to make it a meaningful length - is what you are attempting.
sorta. that page uses "page-break-after:always" on each <TBODY>, giving
you one per page. that i can do. but the challenge is getting it to: 1)
render as many <TBODY>s on a page as fit, and 2) if one cannot fit
entirely, never chop it; instead insert a page-break and render it on
the next page.

the reason for this is, each <TBODY> is a block of related-data, so
paging right in the middle of one is ackward for the end-user. one
needs a way to fit as many whole elements as possible, always inserting
a new page when that cannot be done.

in theory, CSS2 should be able to do this by putting
"page-break-inside:avoid" and "page-break-before:auto" on the <TBODY>.
but that isnt working -- in IE *or* firefox for me (tho yes, i am
primarily concerned w/ IE on my intranet apps).

here is a modified version of your page. note that there are 3 <TBODY>
blocks. note that in firefox only 2 <TBODY>s can fit onto a single page
(in IE, only 1 can). note then how both browsers then split the
non-fitting <TBODY>, rather than inserting a new page as
desired/instructed....:

http://www.sushi-review.com/test/tbody2.html


matt



Reply With Quote
  #9  
Old   
matt@mailinator.com
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-20-2006 , 03:06 PM



Jonathan N. Little wrote:
Quote:
The issue is with IE, so folks wonder why web developers b*tch about IE?
actually, the desired behavior is not working for me in either IE or
firefox. tho for no reason will i stop bitching about IE's failures


matt



Reply With Quote
  #10  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: <TBODY>, IE, and page-break - 09-20-2006 , 04:21 PM



matt (AT) mailinator (DOT) com wrote:

Quote:
here is a modified version of your page. note that there are 3 <TBODY
blocks. note that in firefox only 2 <TBODY>s can fit onto a single page
(in IE, only 1 can). note then how both browsers then split the
non-fitting <TBODY>, rather than inserting a new page as
desired/instructed....:

http://www.sushi-review.com/test/tbody2.html
Don't know but works for me! SeaMonkey 1.0.5 (and Firefox 1.5.0.7) on
Win2k. I get 2 pages


header 1 header 2
header 3 header 4
header 5 header 6

block 1, row 1, col 1
block 1, row 1, col 2
block 1, row 2, col 1
block 1, row 2, col 2
block 1, row 3, col 1
block 1, row 3, col 2
block 2, row 1, col 1
block 2, row 1, col 2
block 2, row 2, col 1
block 2, row 2, col 2
block 2, row 3, col 1
block 2, row 3, col 2

footer 1 footer 2

[pagebreak]

header 1 header 2
header 3 header 4
header 5 header 6

block 3, row 1, col 1
block 3, row 1, col 2
block 3, row 2, col 1
block 3, row 2, col 2
block 3, row 3, col 1
block 3, row 3, col 2

footer 1 footer 2


Which looks like is should. IE does even repeat the table headers and
footers...lost cause. Gee you might have to recommend Firefox for your
intranet! ;=)

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.