Forums
This topic is locked
CSS Help for Tables rows
Posted 30 Oct 2005 14:47:42
1
has voted
30 Oct 2005 14:47:42 chintan sal posted:
Hi I want to develop an ASP page which will be the report for users and the report consist of table and I want every alternate row of that report shoul be of two colors one is violet and other is white.How is it possible can some body help me. Replies
Replied 31 Oct 2005 20:29:54
31 Oct 2005 20:29:54 Dave Thomas replied:
sample asp code for alternating row colours in a table.
<pre id=code><font face=courier size=2 id=code><font color=red>
if intRowColor = 0 Then
Response.Write "<TR class="".row1"">"
intRowColor = 1
Else
Response.Write "<TR class="".row2"">"
intRowColor = 0
End if
</font id=red></font id=code></pre id=code>
create the styles u want in the stylesheet you link to as classes, e.g:
<pre id=code><font face=courier size=2 id=code><font color=blue>
.row1{
background-color: #999;
}
.row2{
background-color: #fff;
}
</font id=blue></font id=code></pre id=code>
hopefully that should work, it's been a while since i touched asp and tables <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
regards
Dave Thomas
<b>DMX Zone Manager</b>
<pre id=code><font face=courier size=2 id=code><font color=red>
if intRowColor = 0 Then
Response.Write "<TR class="".row1"">"
intRowColor = 1
Else
Response.Write "<TR class="".row2"">"
intRowColor = 0
End if
</font id=red></font id=code></pre id=code>
create the styles u want in the stylesheet you link to as classes, e.g:
<pre id=code><font face=courier size=2 id=code><font color=blue>
.row1{
background-color: #999;
}
.row2{
background-color: #fff;
}
</font id=blue></font id=code></pre id=code>
hopefully that should work, it's been a while since i touched asp and tables <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
regards
Dave Thomas
<b>DMX Zone Manager</b>
Replied 04 Nov 2005 11:48:08
04 Nov 2005 11:48:08 chintan sal replied:
Plz can u send me a proper example I mean to say a project relating to it. plz
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
sample asp code for alternating row colours in a table.
<pre id=code><font face=courier size=2 id=code><font color=red>
if intRowColor = 0 Then
Response.Write "<TR class="".row1"">"
intRowColor = 1
Else
Response.Write "<TR class="".row2"">"
intRowColor = 0
End if
</font id=red></font id=code></pre id=code>
create the styles u want in the stylesheet you link to as classes, e.g:
<pre id=code><font face=courier size=2 id=code><font color=blue>
.row1{
background-color: #999;
}
.row2{
background-color: #fff;
}
</font id=blue></font id=code></pre id=code>
hopefully that should work, it's been a while since i touched asp and tables <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
regards
Dave Thomas
<b>DMX Zone Manager</b>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
sample asp code for alternating row colours in a table.
<pre id=code><font face=courier size=2 id=code><font color=red>
if intRowColor = 0 Then
Response.Write "<TR class="".row1"">"
intRowColor = 1
Else
Response.Write "<TR class="".row2"">"
intRowColor = 0
End if
</font id=red></font id=code></pre id=code>
create the styles u want in the stylesheet you link to as classes, e.g:
<pre id=code><font face=courier size=2 id=code><font color=blue>
.row1{
background-color: #999;
}
.row2{
background-color: #fff;
}
</font id=blue></font id=code></pre id=code>
hopefully that should work, it's been a while since i touched asp and tables <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
regards
Dave Thomas
<b>DMX Zone Manager</b>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>