Created
February 17, 2012 09:57
-
-
Save tkjaergaard/1852304 to your computer and use it in GitHub Desktop.
Print table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;jQuery(function($){ | |
| var maxHeight = 800, | |
| total = 0; | |
| // Du bør overvej at indsætte hver tabel som du vil loope igennem i en div som du kan bruge som | |
| // placeholder til at indsætte det modificeret indhold. | |
| $('.placeholder').each(function(){ | |
| $('table tr', $(this)).each(function(i, item){ | |
| var h = $(this).outerHeight(); | |
| if( (total + h) > 800 ) | |
| { | |
| // Indsæt </table> + <hr style="page-break-after:always" /> | |
| } | |
| else | |
| { | |
| // Hvis ikke over 800 append, indsæt i tabel | |
| } | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment