Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > <TBODY>, IE, and page-break

Reply
Thread Tools

<TBODY>, IE, and page-break

 
 
matt@mailinator.com
Guest
Posts: n/a
 
      09-19-2006
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
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-19-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      09-19-2006
In alt.html, (E-Mail Removed) wrote:

> i have an html table that consists of blocks of related data -- each
> block contains three rows. ...


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>


A thought, but untested. Don't have any handy tables to produce this.

--
-bts
-Motorcycles defy gravity; cars just suck.
 
Reply With Quote
 
matt@mailinator.com
Guest
Posts: n/a
 
      09-19-2006

Jonathan N. Little wrote:
> 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
 
matt@mailinator.com
Guest
Posts: n/a
 
      09-19-2006
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:
> 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
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-19-2006
(E-Mail Removed) wrote:
TOP POSTING CORECTED

> 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
 
matt@mailinator.com
Guest
Posts: n/a
 
      09-19-2006

Jonathan N. Little wrote:
> Well it might help if you close them, I assume you *meant* to, else you
> have 2 TBODYs together with one being empty.


yes, i did mean to.

> TBODY { page-break-inside: avoid; }


i tried this, but it didnt work either -- at the bottom of a given
page, IE 6 still may render only two of the 3-row <tbody> rows, and
then span the third to the top of the next page.

im not even sure if it supports it, or if perhaps i need a certain doc
type, or what. currently im using:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >


thanks,
matt

 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      09-19-2006
In alt.html, (E-Mail Removed) wrote:

> 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.


Waiddaminnit. You said you had data in blocks of three rows. Yet you
illustrated three _single_rows_, each in a separate <tbody>. Go look at
your OP again.

> 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.


But that is not what you showed in your OP. You showed ONE row per
<tbody>.

Please don't top-post. Thanks.

--
-bts
-Motorcycles defy gravity; cars just suck.
 
Reply With Quote
 
matt@mailinator.com
Guest
Posts: n/a
 
      09-20-2006

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).


<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
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      09-20-2006
In alt.html, (E-Mail Removed) 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.

--
-bts
-Motorcycles defy gravity; cars just suck.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments