Link to home
Start Free TrialLog in
Avatar of Stiebel Eltron
Stiebel EltronFlag for Thailand

asked on

How to create alternate row color?

<body bgproperties="fixed" bgcolor="#000000" onLoad="javascript:startmenu()">

	Dim myConnection
	Dim rsUsers
	Dim connectString
	Dim sqlString
	Dim requestName


	Set myConnection = Server.CreateObject("ADODB.Connection")
	Set rsUsers = Server.CreateObject("ADODB.Recordset")

	myConnection.Open connectString


	sqlString = "Select * From users ORDER BY ID ASC"
	Set rsUsers = myConnection.Execute(sqlString)


<table width="760" border="0" cellspacing="3" cellpadding="1">
    <td width="134"><img src="../IMG/logo_res.jpg" alt="STIEBEL ELTRON" /></td>
    <td width="620" valign="top" bgcolor="#666666"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,28,0" width="548" height="197">
      <param name="movie" value="homeintro20.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <embed src="homeintro20.swf" quality="high" wmode="opaque" pluginspage="" type="application/x-shockwave-flash" width="548" height="197"></embed>
    <td width="134" bgcolor="#FFFFFF"><img src="../IMG/white_square.png" alt="ASIA" border="0" align="top"/></td>
    <td bgcolor="#666666">&nbsp;</td>
    <td align="right" bgcolor="#999999"><font face="Verdana, Geneva, sans-serif" color="#ffffff">
   '// If user is logged in show name and logout link
   If Session("loggedin") = true Then
      Response.Write "Welcome: " & Session("FName")
      Response.Write "<br /><a href=""../asia2/login/logout.asp"">Logout</a>"
      Response.Write "<a href=""../ste-iphoto-login2.asp"" title=""CLICK TO LOGIN"">REGISTERED USERS</a>"
   End If
    <td bgcolor="#666666" align="center">&nbsp;</td>
    <td bgcolor="#999999">&nbsp;</td>
    <td align="left" bordercolor="#999999" bgcolor="#000000"><img src="../IMG/admin_panel.jpg" width="548" /><br></td>
    <td bgcolor="#999999" valign="top" align="center">&nbsp;
    <td colspan="3" bgcolor="#FFFFFF">
    <table width="100%" border="1" cellpadding="0" cellspacing="1" bordercolor="#999999">
            	<td class="td1" bgcolor="#CCCCCC">ID</td>
                <td class="td1" bgcolor="#CCCCCC">ID</td>
               	<td class="td1" bgcolor="#CCCCCC">FIRST NAME</td>
            	<td class="td1" bgcolor="#CCCCCC">LAST NAME</td>
                <td class="td1" bgcolor="#CCCCCC">EMAIL</td>
                <td class="td1" bgcolor="#CCCCCC">PASSWORD</td>
                <td class="td1" bgcolor="#CCCCCC">COUNTRY</td>
                <td class="td1" bgcolor="#CCCCCC">TELEPHONE</td>
                <td class="td1" bgcolor="#CCCCCC">MOBILE</td>
                <td class="td1" bgcolor="#CCCCCC">COMPANY</td>
                <td class="td1" bgcolor="#CCCCCC">ADDRESS</td>
                <td class="td1" bgcolor="#CCCCCC">STATUS</td>
            <!--Get DATA-->      
		do while not rsUsers.EOF
            	<td class="td2"><a href="javascript:myPopup('edit_user.asp?USERID=<%=rsUsers("ID")%>', 'EDITUSER','960','600','10','300')"><img src="../IMG/edit_icon_small.png" alt="EDIT USER" border="0"/></a></td>
                <td class="td2"><%=rsUsers("ID")%></td>
               	<td class="td2"><%=rsUsers("FName")%></td>
            	<td class="td2"><%=rsUsers("LName")%></td>
                <td class="td2"><%=rsUsers("Email")%></td>
                <td class="td2"><%=rsUsers("Password")%></td>
                <td class="td2"><%=rsUsers("Country")%></td>
                <td class="td2"><%=rsUsers("Telephone")%></td>
                <td class="td2"><%=rsUsers("Mobile")%></td>
                <td class="td2"><%=rsUsers("Company")%></td>
                <td class="td2"><%=rsUsers("Address")%></td>
                <td class="td2"><%=rsUsers("Status")%></td>
		<% rsUsers.MoveNext %>
<%loop %><!--Next Row-->

Open in new window

Dear EE experts,

We would like to ask for tech support on how to create alternating row color.
We tried some stuff from the web, but we failed to create one...
Here's the link of the site that we would like to have alternating row color:

Thank you...
Avatar of Atique Ansari
Atique Ansari
Flag of India image

You can use CSS3. Find below URL for more details.
Avatar of Kiran Paul VJ
Kiran Paul VJ
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Stiebel Eltron


Both are best solution...

Thank you!
Glad to know it helped.

@Kiranvj, thanks for the support :)
Just a note if you are going to use this for any html5 stuff, you will want to use a css class instead of the row background color if you care about validation.
Just a addon to padas, if you are using html5, defenitly css3 will be working in that browser. So you can try CSS3 even/odd feature. As of now it will not support in all browsers, hence not recommended.