I know that this should be super easy but I haven’t figured it out yet. I’d like to append a < td> to the first row of my table. I tried with this:
$table.get('tr:first').append("<td>Well "+(wellN)+"</td>");
But it didn’t work. I also used this:
$($table +' tr:first').append("<td>Well "+(wellN)+"</td>");
But as expected, I got the following error:
Uncaught Syntax error, unrecognized expression: [object Object]
Everything else is working right with my table Object.
You want to use
.find()as.get()only takes in integers as a parameter:From the docs:
So change out
.get()for.find():This assumes that
$tableis a jQuery object of the table element you want to alter. E.g.$table = $('table');Here is a jsfiddle of the above solution: http://jsfiddle.net/jasper/SRsnq/