use javascript:<table id="tbl" border="1" onclick="getRowCell()">
<tr>
<td>00</td><td>01</td>
</tr>
<tr>
<td>10</td><td>11</td>
</tr>
</table><script language=javascript>
function getRowCell()
{
var e = event.srcElement;
var nRow, nCell;
if (e.tagName == "TD");
nCell = e.cellIndex; var tr = e.parentElement;
if (tr.tagName == "TR")
nRow = tr.rowIndex; alert(nRow + "-" + nCell);
}
</script>if you want to the information on the server side, you need to send the above information back through some hidden controls
<tr>
<td>00</td><td>01</td>
</tr>
<tr>
<td>10</td><td>11</td>
</tr>
</table><script language=javascript>
function getRowCell()
{
var e = event.srcElement;
var nRow, nCell;
if (e.tagName == "TD");
nCell = e.cellIndex; var tr = e.parentElement;
if (tr.tagName == "TR")
nRow = tr.rowIndex; alert(nRow + "-" + nCell);
}
</script>if you want to the information on the server side, you need to send the above information back through some hidden controls
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货