apamphilon

Set height based on parent element (good for table based centering)

// table height
tableHeight(); //call the function initally
setTimeout(tableHeight, 300); //call the function again after giving the site 300ms to kick in
$(window).resize(tableHeight); //bind the function to the resize event

function tableHeight() {
  // set table element height to parent height
  $('.table-div').css('height', $('.parent-div').outerHeight());
}

Comments: