consolidate table td and th query I have two statements that look like this: 

$('table tr td:nth-child(' + columnNumber + ')').toggle();
$('table tr th:nth-child(' + columnNumber + ')').toggle();


Is there a way to combine these two statements?
A comma.

$('table tr td:nth-child(' + rowNumber + '), table tr th:nth-child(' + rowNumber + ')').toggle();


jQuery's selectors are the same as CSS (with some stuff added here and there), so all the usual CSS selector rules apply:

$("div, h1")  // select div and h1 elements
$("div h1")   // select h1 elements that are nested somewhere within a div
$("div &gt; h1") // select h1 elements that are direct descendants of a div


Etc.

By the way, rowNumber doesn't make sense; the code will select a given column, not a row.