JohnShell
04-23-2011, 10:22 PM
Hi,
Seek help about how to have alternating group row colors. Have HTML table dynamically populated from database via coldfusion. 6 columns / 2 rows represent one row from database. Table header shows the database fields using horizontal ruler tag <hr>.
Want to have alternating row group colors for ease of recognition for users - eg - first two rows light gray - next two rows white - next two rows light gray - next two rows white and so on.
Code for table is below - any help on how to do this greatly appreciated!
<div style="width:900px; position:relative; ">
<cfinput type="submit" id="enter" name="decSend" value="Submit" style="font-size:14px; font-weight:bold;" >
<br /><p>
<table width="900" border="1" cellspacing="1" cellpadding="2" style="position:relative; left:50px">
<tr>
<td width="140" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Name<hr />Begin Date</font></td>
<td width="100" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Request Date<hr />End Date<font></td>
<td width="150" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold">Type of Hrs<hr />Request Justification</font></td>
<td width="100" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Number Hrs Req<hr />Rel Comp Begin Date</font></td>
<td width="100" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Projects<hr />Rel Comp End Date</font></td>
<td width="220" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Decision<hr />Leave Slip Submitted</font></td>
</tr>
<cfoutput query="Req">
<tr style="background-color:'FFFFFF';" onMouseOver="this.style.backgroundColor='FFCC33';" onMouseOut="this.style.backgroundColor='FFFFFF'" >
<td > #Name#</td>
<td > #DateFormat(RequestDate, "m/d/yyyy")#</td>
<td > #TypeofHours#</td>
<td> #NumberHrsRequested#</td>
<td> #project#</td>
<td> #Decision#
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="approved" size="1">Approved
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="denied" size="1">Denied
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="" size="1" checked="yes">N/A
</td>
</tr>
<tr style="background-color:'FFFFFF';" onMouseOver="this.style.backgroundColor='FFCC33';" onMouseOut="this.style.backgroundColor='FFFFFF'" >
<td> #DateFormat(BeginDate, "m/d/yyyy")#</td>
<td> #DateFormat(EndDate, "m/d/yyyy")#</td>
<td> #justification#</td>
<td> #DateFormat(RCBDate, "m/d/yyyy")#</td>
<td> #DateFormat(RCEDate, "m/d/yyyy")#</td>
<td> #RCLeaveSlip#</td>
</tr>
</cfoutput>
</table>
</div>
Many thanks,
John
Seek help about how to have alternating group row colors. Have HTML table dynamically populated from database via coldfusion. 6 columns / 2 rows represent one row from database. Table header shows the database fields using horizontal ruler tag <hr>.
Want to have alternating row group colors for ease of recognition for users - eg - first two rows light gray - next two rows white - next two rows light gray - next two rows white and so on.
Code for table is below - any help on how to do this greatly appreciated!
<div style="width:900px; position:relative; ">
<cfinput type="submit" id="enter" name="decSend" value="Submit" style="font-size:14px; font-weight:bold;" >
<br /><p>
<table width="900" border="1" cellspacing="1" cellpadding="2" style="position:relative; left:50px">
<tr>
<td width="140" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Name<hr />Begin Date</font></td>
<td width="100" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Request Date<hr />End Date<font></td>
<td width="150" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold">Type of Hrs<hr />Request Justification</font></td>
<td width="100" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Number Hrs Req<hr />Rel Comp Begin Date</font></td>
<td width="100" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Projects<hr />Rel Comp End Date</font></td>
<td width="220" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold"> Decision<hr />Leave Slip Submitted</font></td>
</tr>
<cfoutput query="Req">
<tr style="background-color:'FFFFFF';" onMouseOver="this.style.backgroundColor='FFCC33';" onMouseOut="this.style.backgroundColor='FFFFFF'" >
<td > #Name#</td>
<td > #DateFormat(RequestDate, "m/d/yyyy")#</td>
<td > #TypeofHours#</td>
<td> #NumberHrsRequested#</td>
<td> #project#</td>
<td> #Decision#
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="approved" size="1">Approved
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="denied" size="1">Denied
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="" size="1" checked="yes">N/A
</td>
</tr>
<tr style="background-color:'FFFFFF';" onMouseOver="this.style.backgroundColor='FFCC33';" onMouseOut="this.style.backgroundColor='FFFFFF'" >
<td> #DateFormat(BeginDate, "m/d/yyyy")#</td>
<td> #DateFormat(EndDate, "m/d/yyyy")#</td>
<td> #justification#</td>
<td> #DateFormat(RCBDate, "m/d/yyyy")#</td>
<td> #DateFormat(RCEDate, "m/d/yyyy")#</td>
<td> #RCLeaveSlip#</td>
</tr>
</cfoutput>
</table>
</div>
Many thanks,
John