我如何在添加到表中的一组新行上使用jQuery的slideDown()?

时间:2022-08-15 17:34:44

I'm adding several new rows to an existing table with an event. I want these new rows to show up with the slideDown() effect.

我正在使用事件向现有表添加几个新行。我希望这些新行显示slideDown()效果。

Using slideDown() on the entire table will slide down the whole table and not just the new rows. I can't make another table because the columns won't align. And if I make the columns of the new table the same pixel size as the old table, it won't resize correctly when the page resizes or other stuff is added/removed to the DOM.

在整个表上使用slideDown()将向下滑动整个表而不仅仅是新行。我不能创建另一个表,因为列不会对齐。如果我使新表的列与旧表的像素大小相同,则在页面调整大小或向DOM添加/删除其他内容时,它将无法正确调整大小。

It says here that several tbody tags can be in one table. I tried adding new ones and it didn't work. But even if it did it doesn't matter because if I use the slide animations on the tbody tags it doesn't animate it just instantly disappears/appears.

它在这里说几个tbody标签可以在一个表中。我尝试添加新的,但它没有用。但即使它确实无关紧要,因为如果我在tbody标签上使用幻灯片动画它没有动画它只是立即消失/出现。

1 个解决方案

#1


2  

I had the same problem. slideDown does not work in TRs. To solve the problem I've put a Div inside the TDs.

我有同样的问题。 slideDown在TR中不起作用。为了解决这个问题,我把一个Div放在了TD中。

#1


2  

I had the same problem. slideDown does not work in TRs. To solve the problem I've put a Div inside the TDs.

我有同样的问题。 slideDown在TR中不起作用。为了解决这个问题,我把一个Div放在了TD中。