• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pageBreaks question

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Here is a scenario I need some direction on:

<LINK rel="stylesheet" href="../some_style_sheet.css" type="text/css">

for loop start
<table>
<tr><td>VALUES RETREIVED FROM DB</td></tr>
</table>
for loop end

The loop can run upto 100 times. The external style sheet is used to format the contents within the <tr></tr> tags.

"VALUES RETREIVED FROM DB" is dynamic, and hence each row height is different throughout the loop, but when printed, the row height never exceeds the page height.

Now, I want to print all the 100 rows, I want to avoid page breaks between <tr></tr> tags. I cannot use the CSS "page-break-before:always "as each row height is different. I was wondering if I could use the xsl attribute, "keep-together.within-column". I am relatively new to xsl, xslt, xsl-fo and any help on how to get this working would be much appreciated. I am developing jsp using unix and jboss. Thanks in advance.
[ January 21, 2006: Message edited by: sridhar anna ]
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can anyone point me in a direction how to make pageBreaks.

Much Thanks.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay. I will take a wild guess: you are talking about the printed version of an HTML page.

In that case, if you want to avoid page breaks inside a certain element, then the CSS style "page-break-inside:avoid" is probably what you are looking for. I found a description of that here:

http://www.w3schools.com/css/pr_print_pagebi.asp

However if your "pages" are some other pages (for example you mentioned XSL-FO which would suggest they are PDF pages) then clarification would be welcome.
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the reply.

I already tried the css approach. It doesnot work for me as the row heights are not constant. And within the html, I pull data from the database and put it in each row and that data determines the row height.

Is there any other approach other than CSS. Thanks in advance.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If page-break-avoid doesn't work for you, then it wasn't because the row heights aren't constant. That CSS style doesn't have anything to do with rows as such, it works on blocks. And when it is invoked it should not care about other times (i.e. other rows) when it was or was not invoked.

So if you found it didn't work, that was either because (a) the browser you tried it in doesn't handle it correctly, or (b) you didn't use it correctly.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic