Skip to content

Instantly share code, notes, and snippets.

@TakuyaHarayama
Created May 9, 2018 06:58
Show Gist options
  • Save TakuyaHarayama/c089ad7b8f0bd19f750982c9b9acbdd4 to your computer and use it in GitHub Desktop.
Save TakuyaHarayama/c089ad7b8f0bd19f750982c9b9acbdd4 to your computer and use it in GitHub Desktop.
ヘッダー付きtableのカラムを増やすjQuery
// ヘッダー付きtableのカラムを増やすjQuery
$('table').find('tr').each(function(){
if ($('table').index(this)) {
$(this).find('th:last-child').after('<th>new column added</th>');
}
$(this).find('td:last-child').after('<td>new cell added</td>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment