Skip to content

Instantly share code, notes, and snippets.

@tkjaergaard
Created February 17, 2012 09:57
Show Gist options
  • Select an option

  • Save tkjaergaard/1852304 to your computer and use it in GitHub Desktop.

Select an option

Save tkjaergaard/1852304 to your computer and use it in GitHub Desktop.
Print table
;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