-1

Possible Duplicate:
slideToggle in table row

I have a table and I'm using jquery's slideToggle() to show and hide some rows.

Slidetoggle doesn't works ok (it doesn't animate) if you don't show the element <tr> to toggle as a block (display:block).

The problem: if I set the <tr> as a block, it shows the content of <td>'s in the same column (the first).

Here you have:

http://jsfiddle.net/7LH3p/6/

Any idea?

Community
  • 1
  • 1
tirenweb
  • 30,963
  • 73
  • 183
  • 303

2 Answers2

2

To animate TR's I recommend you to enclose the TD contents in divs, then animate the divs, see my working demo.

Nelson
  • 49,283
  • 8
  • 68
  • 81
  • yes, it works smoother with divs. – tirenweb Oct 04 '12 at 16:49
  • Yes it's smoother, it's how I use it on my projects because animating the TD's or TR's directly causes bad results from my experience. – Nelson Oct 04 '12 at 17:27
  • anyway what I was looking for is to slide the content of a group of trs. I found something about it here: http://stackoverflow.com/questions/5111826/using-jquery-to-slidetoggle-a-group-of-table-rows . My question: is there any way to use `slideToggle()` instead of `toggle()` in that case? – tirenweb Oct 05 '12 at 07:49
1

I think it may be because you are making just ONE tr have a style of block. When I set them all to be block looks like everything lines up alright:

http://jsfiddle.net/yuadX/

Dameo
  • 334
  • 2
  • 7