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:

  1. use table id or class instead of index identification because if move table in dom, selector break

  2. i'm pretty sure don't need "tr"

so:

 $("#mytable td:first-child").remove() 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -