[Javascript] Inserting a spacer row

Paul Novitski paul at novitskisoftware.com
Fri Apr 8 11:30:50 CDT 2005


At 08:57 AM 4/8/2005, Steve Clason wrote:
>As part of a CMS for fitness company, we've made weekly exercise schedules 
>that instructors without great html skills will be maintaining. To make 
>their lives easier, we wanted to insert a row with a red line above any 
>table row that contained a day of the week (except Monday).
>
>Here's the script:
...

Steve,

Ditto what Matt said about using className.

Possibly one reason IE isn't showing the line is because the cells don't 
have content and might be collapsing to zero height.

I don't think you should have to insert a new row, just apply the red 
border to all the cells on that row, something like this:

<tr class="newDay">
         <td>...</td>
         <td>...</td>
         <td>...</td>
</tr>

tr.newDay td
{
         border-top: 2px solid #F00;     /*red*/
}

Since you're generating the page server-side from ColdFusion, why not 
simply apply a special class to each row that begins a weekday from that 
side of the fence?

Paul 





More information about the Javascript mailing list