Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print entire row in page or next page 1

Status
Not open for further replies.

fairfaxVB

Programmer
Nov 3, 2005
46
US
Hi friends,
Do we have any way to control print a entire row.
we have a dynamical table. When user print report which has more than one pages, it print half row in paper bottom. we can not control buttom margins for this issue. Because there are 2 line data in each row. So we like to control print. if there space is a little for entire row. the entire row should go to next page.
thanks for any help
 
no, you cannot calculate font metrics in javascript.

the best you can do is use css to force a page break after a "safe" number of rows, where "safe" is determined by you looking at the page and saying "X number of rows will fit without overflow"

then during server side rendering, insert the css page break every X rows

e.g. if you determined 2 rows would fit safely, then generate code like this:
Code:
<style type="text/css">
 .break { page-break-after: always; }
</style>

<table>
 <tr>
  <td>data</td>
 </tr>
 <tr>
  <td class="break">data</td>
 </tr>
 <tr>
  <td>data</td>
 </tr>
 <tr>
  <td class="break">data</td>
 </tr>
 <tr>
  <td>data</td>
 </tr>
 <tr>
  <td>data</td>
 </tr>
</table>

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top