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?




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

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

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