Here's a basic way to do it. Works only in IE4+ and maybe NS6. Same goes for Hotmail, btw.
<HTML>
<HEAD>
<TITLE></TITLE>
<style type="text/css">
td {
cursor: default
}
</style>
</HEAD>
<BODY>
<table id=Table1 onclick="getRow()" border="1">
<tr>
<td>
<input type="checkbox" value="" />
</td>
<td>
Cell one
</td>
<td>
Cell two
</td>
<td>
Cell three
</td>
</tr>
<tr>
<td>
<input type="checkbox" value="" />
</td>
<td>
Cell one
</td>
<td>
Cell two
</td>
<td>
Cell three
</td>
</tr>
</table>
<script>
function getRow(){
var el = event.srcElement
var rowIdx = 0
var tbl = null
var oRow = null
if (el.tagName =="INPUT"){
rowIdx = el.parentElement.parentElement.rowIndex
tbl = document.getElementById("Table1")
oRow = tbl.rows[rowIdx]
if (eval(el.getAttribute("checked"))){
colorCells(oRow, "khaki") // or whatever color
}
else{
colorCells(oRow, "white")
}
}
}
function colorCells(oRow, color){
var cell = null
for(x=0;x<oRow.cells.length;x++){
cell = oRow.cells[x]
cell.bgColor = color
}
}
</script>
</BODY>
</HTML>
Enter your message below
Sign in or Join us (it's free).