Regarding Pagebreaks

Reply

Join Date: Oct 2008
Posts: 6
Reputation: asp_seetha is an unknown quantity at this point 
Solved Threads: 0
asp_seetha asp_seetha is offline Offline
Newbie Poster

Regarding Pagebreaks

 
0
  #1
Oct 15th, 2008
Hai,
I've read about "page-break-inside" style and it seems to be
exactly what I need. I am working on some report printings, and I need
specific table to be printed on following page if it does not fit in the
current one. Unfortunatelly, I cannot solve this issue... Does
page-break-inside not work? I have made some tests on IE 7.0 and it
simply does nothing. How should I use this style?... Here is my code:

<table style="page-break-inside:avoid;">
<tr>
<td align="center" valign="middle">31</td>
<td align="center" valign="middle">32</td>
<td align="center" valign="middle" id="cell3">33</td>
<td align="center" valign="middle" id="cell1">13</td>
</tr>
</table>

Can you help me?
Thank you very much!

Seetha
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 89
Reputation: msaqib is an unknown quantity at this point 
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: Regarding Pagebreaks

 
0
  #2
Oct 18th, 2008
Originally Posted by asp_seetha View Post
I need specific table to be printed on following page if it does not fit in the current one. Unfortunatelly, I cannot solve this issue... Does page-break-inside not work? I have made some tests on IE 7.0 and it simply does nothing. How should I use this style?
Well you can not take a decision at run time that whether the table will fit on the page or not. So you can use any of the CSS property page-break-after, page-break-before or page-break-inside to insert page breaks. So either you will have to put page break at the beginning of the table of at the end of the table and you can not predict whether it should be before or after the table.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 6
Reputation: asp_seetha is an unknown quantity at this point 
Solved Threads: 0
asp_seetha asp_seetha is offline Offline
Newbie Poster

Re: Regarding Pagebreaks

 
0
  #3
Oct 25th, 2008
Hai

Thanks for the support.

BUt Im creating dynamic tables. The tables are not fixed size. One page may contain two or more tables. That is not specified in the program code. I cannot set page break before or after the tables, If I set means each table will print in one page. I dont want like that. If the table is not fit to the page, automatically it should go to the next page. I am using pagebreakinside in CSS. But it is not working... Any other way.

Thanks

Seetha
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 66
Reputation: Baradaran is an unknown quantity at this point 
Solved Threads: 4
Baradaran Baradaran is offline Offline
Junior Poster in Training

Re: Regarding Pagebreaks

 
0
  #4
Oct 26th, 2008
Hi,
dynamic width and dynamic number of tables is not possible, just as msaqib said, you have to make the decision about the page break before you put the style into css.

If you want to make both table width and page breaks dynamic, then you have to take a greater step, and make some calculation:

1. Define the width of the page
2. Define font size
3. Get approx. width of each character in that specific font size (width of i and width of w / 3 * 2).
4. Define the margins and paddings
5. Make calculation of the achieved width during page generation by:
counting characters, multiplying with average font-width, add margin and padding, set as achieved width of table.

Now prior to sending the whole stuff to the browser, you have to put the whole text into variables, so that you can calculate whether the next table fits in the space between the last table and the edge of the page.

If the table fits into the space, then put it there, else simply add a page break before the table.

This is a little complicated and takes time, but it's possible.

Good luck.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 6
Reputation: asp_seetha is an unknown quantity at this point 
Solved Threads: 0
asp_seetha asp_seetha is offline Offline
Newbie Poster

Re: Regarding Pagebreaks

 
0
  #5
Nov 3rd, 2008
Thank you much. Now I am having clear idea. I will try this and reply back
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Regarding Pagebreaks

 
0
  #6
Nov 19th, 2008
Moderators need to move this to the CSS forum because i don't see how this fits into ASP.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Regarding Pagebreaks

 
0
  #7
Nov 23rd, 2008
Make the decision at print time by selecting the table, and then print only the selection.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: Mamon003 is an unknown quantity at this point 
Solved Threads: 0
Mamon003 Mamon003 is offline Offline
Newbie Poster

Re: Regarding Pagebreaks

 
0
  #8
Nov 25th, 2008
The tables are not fixed size. One page may contain two or more tables. That is not specified in the program code. I cannot set page break before or after the tables, If I set means each table will print in one page. I dont want like that. If the table is not fit to the page, automatically it should go to the next page. I am using pagebreakinside in CSS. But it is not working... Any other way.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Regarding Pagebreaks

 
0
  #9
Nov 26th, 2008
Not all printers are created equally.

You are having problems because the printer is not controlled by either the web browser or the html code. It is controlled by the printer driver that came with the printer. This function (and its settings) belongs to the owner of the computer rendering the page, not to you.

Your code can not know in advance how many lines the printer attached to the user's system can put on a page, or how the printer will lay out a table. It will be different if a user with a different printer opens the page. Just like different screen resolutions, there are different printer pixel resolutions.

So all of the rules that apply to different screens (and their disadvantages) also apply to different printers. Not only can't you know where the printer will break a page, you can't even know how large the printed page is, in terms of how much content fits on a page.

To get all of a table (or multiple tables) onto a page, the user should select the parts he wants to print, and then use Print Selection on the printer dialog box.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC