Skip to content

Instantly share code, notes, and snippets.

@timsnadden
Created March 12, 2010 19:32
Show Gist options
  • Save timsnadden/330678 to your computer and use it in GitHub Desktop.
Save timsnadden/330678 to your computer and use it in GitHub Desktop.
$('li:last-child, th:last-child, td:last-child, tr:last-child').addClass('last-child');
$('li:first-child, th:first-child, td:first-child, tr:first-child').addClass('first-child');
$('input').addClass(function() { return $(this).attr('type'); });
$('input[readonly]').addClass('readonly');
$('th').addClass(function() { return $(this).attr('scope'); });
if($.browser.msie) {
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
$('table').attr('cellspacing', 0);
$('td:empty, th:empty').html(' ');
}
if($.browser.mozilla &! Array.reduce) { $('body').addClass('oldgecko'); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment