$(function(){
  var docH = $(document).height();
  var tblH   = $('table#tableWindow').height();
  if ( docH >= tblH ){
   $('table#tableWindow').css({"height":docH});
  }
});