tags:

views:

257

answers:

5

I have a regular HTML table, how can I show and hide a table row using jQuery?

+1  A: 

Either iterate the tr elements inside your table or add id's to your trs and calling the show/hide function in jQuery with that ID

Nuno Furtado
+3  A: 

Hides every 5th row:

$('tr:nth(5)).hide()

An example: http://jsbin.com/epeto

altCognito
A: 

Just to add to Nuno's answer above, JQuery's toggle() function may also be useful to you

Colin
+1  A: 

Also, you might want to look at the .toggle() function.

$('tr:nth(5)).toggle()

This will show/hide it and continually switch...

Boushley
A: 

I would steer clear of the show and hide methods for table rows. They lead to bad ui effects x-browser. I have found fadeIn/Out to work much better x-browser.

redsquare