# Page.replace.html for tables ?

**URL:** <https://discuss.rubyonrails.org/t/page-replace-html-for-tables/5542>\
**Category:** rubyonrails-talk\
**Created:** [December 7, 2006, 12:38am UTC](https://discuss.rubyonrails.org/t/page-replace-html-for-tables/5542 "2006-12-07T00:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dark\_Ambient](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@Dark\_Ambient](https://discuss.rubyonrails.org/u/Dark_Ambient)\
**Post date:** [December 7, 2006, 12:38am UTC](https://discuss.rubyonrails.org/t/page-replace-html-for-tables/5542/1 "2006-12-07T00:38:47Z")

</div>

I have a div around the tbody section of a table. I want the entire tbody removed and replaced. Doesn’t seem to be working though. Is there a problem with page.replace and tables ?

Stuart

---

<div class="post-metadata">

**Author:** ![Philip\_Hallstrom1](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@Philip\_Hallstrom1](https://discuss.rubyonrails.org/u/Philip_Hallstrom1)\
**Post date:** [December 7, 2006, 1:04am UTC](https://discuss.rubyonrails.org/t/page-replace-html-for-tables/5542/2 "2006-12-07T01:04:16Z")

</div>

> I have a div around the tbody section of a table. I want the entire tbody removed and replaced. Doesn't seem to be working though. Is there a problem with page.replace and tables ?

Not a solution, but .... [http://dev.rubyonrails.org/ticket/4273](http://dev.rubyonrails.org/ticket/4273)

---

<div class="post-metadata">

**Author:** ![Dark\_Ambient](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@Dark\_Ambient](https://discuss.rubyonrails.org/u/Dark_Ambient)\
**Post date:** [December 7, 2006, 1:04pm UTC](https://discuss.rubyonrails.org/t/page-replace-html-for-tables/5542/3 "2006-12-07T13:04:33Z")

</div>

Well, I’m experiencing the problem in Firefox , not in IE. Anyway I tried the suggestion about remove and insert, the remove works, the insert doesn’t.

In the page that loads

\<%= render :partial =\> 'addrow'%\>

Notice I surrouned the partial with a div, so in the RJS -

page.remove ‘some\_div’ page.replace\_html ‘firstdiv’, :partial =\> ‘addrow’

I tried page.insert\_html ‘after’, 'firstdiv", :partial =\> ‘addrow’

Same results. Page.remove works, page insert or replace does not.

Any reason why ?

Stuart
