Skip to content

Instantly share code, notes, and snippets.

@esauro
Created May 16, 2012 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esauro/2711509 to your computer and use it in GitHub Desktop.
Save esauro/2711509 to your computer and use it in GitHub Desktop.
jQuery selector for table rows o table cols based on http://programanddesign.com/js/jquery-select-table-column-or-row/, modified to make row includes th
<script>
$.fn.row = function(i) {
return $('tr:nth-child('+(i+1)+') td, tr:nth-child('+(i+1)+') th', this);
}
$.fn.column = function(i) {
return $('tr td:nth-child('+(i+1)+')', this);
}
$('table').row(2).hide();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment