Topic: Highlight effect in table over CSS

I'm trying to generate a highlight effect upon creating a new row in a 'names' table. The 'new_item' highlight effect in create_name.rjs shows up on some places on the page, but not in the table cell on _names.rhtml where I want it . I know there are a few issues with the highlight effect and have removed the :endcolor definition and changed my css declaration from 'background' to 'background-color'. I'm still stumped though. Any idea what could be mucking it up?

Thanks,

Peter

_names.rhtml

<table id='list'>
    <% for name in @person.current_names %>
        <% if personname == @new_name %>
          <tr id="new_item">
        <% else %>
          <tr>
        <% end %>
    <td id="list_item"><%= link_to_function (personname.full_name), :action => 'update_name', :id => @claimant_name, :onclick => "Element.show('update_name')"%></td>
    </tr>
    <% end %>
</table>

style.css
td#list_item {
    background-color: #fff;
    padding: 2px;
    border: 1px solid #CBD0D8;
}

create_name.rjs
page.replace_html("name_list", :partial => "names", :object => @person)
page[:new_item].visual_effect :highlight,
                              :startcolor => "#88ff88"

Re: Highlight effect in table over CSS

I got this to work by taking the table out of _names.rhtml and use divs.

Re: Highlight effect in table over CSS

you need to set the table CSS to border-collapse: collapse; if you want to highlight an entire TR

Re: Highlight effect in table over CSS

oh, nice. I've moved away from tables almost completely at this point, but that you for the advice smile