Posted by Jonathan N. Little on 09/28/05 20:55
Beauregard T. Shagnasty wrote:
> booner wrote:
>
>
>>I was trying to simplify things - I have in fact used CSS - and done
>>very similar to what you described (the table is created dynamically
>>in ASP).
>
>
> Even easier, then.
>
> Within your loop:
>
> intCount = 0
> Do While Not oRs.EOF
> intCount = intCount + 1
> Response.Write "<tr>"
> If intCount Mod 2 = 0 Then
> strBgColor = "#ffffcc"
> Else
> strBgColor = "#ffffff"
> End If
> %>
>
> <td style="background-color: <%= strBgColor%>"> <%= [yourvariables]
> %></td>
> <%
> Response.Write "</tr>"
> ...
>
> You could even eliminate the style on every other row, if it was to
> match the background of the table or page...
>
Still would think using a class styling would be better option than
hard-coding the color into the ASP function. Then if later down the road
the site changes color schemes where now said table becomes illegible
you have to change the APS function. You can coordinate the change
better with CSS...
my $.02
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|