jquery - how to remove the first column of every row? -
i having trouble trying remove first column every row. have felling understanding of jquery.
i've tried following.
$("table:eq(2) tr td:first").remove() // removed first cell $("table:eq(2) tr td:first").each.remove() // didn't notice difference
any ideas of i'm doing wrong?
try using td:first-child instead of td:first
see page more: http://api.jquery.com/first-child-selector/
p.s. couple of suggestions jquery selector:
use table id or class instead of index identification because if move table in dom, selector break
i'm pretty sure don't need "tr"
so:
$("#mytable td:first-child").remove()
Comments
Post a Comment