Skip to content

Instantly share code, notes, and snippets.

@imlucas
Created September 23, 2009 16:02
Show Gist options
  • Select an option

  • Save imlucas/192085 to your computer and use it in GitHub Desktop.

Select an option

Save imlucas/192085 to your computer and use it in GitHub Desktop.
$('#myDiv').find('table').find('tr').each(function() {
var tr = $(this), w = 0;
tr.find('td').each(function() {
w += $(this).outerWidth();
});
if (w > tr.width()) {
$('#myDiv').find('table').css('table-layout', 'auto');
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment