如何确定html表格中单元格的行号和库仑数 [英] How can I determine the row number and coulumn number of a cell in an html table

查看:108
本文介绍了如何确定html表格中单元格的行号和库仑数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个html表,其中有10列作为字段(TC1,TC2 ..... TC10)和10行(R1,R2 ..... R10).根据TC1与R1,TC1与R2等的组合,此功能仅包含通过和失败数据.

当用户单击任何值为失败"的单元格时.
我需要检索该单元格的</brow和列号的值.此点击可以发生在任何值为失败"的呼叫上.

我需要行和列的值来进行进一步的计算

Hi,

I have an html table with 10 columns as fields(TC1,TC2.....TC10) and 10 rows (R1, R2,........R10). This able contains only pass and fail data as per the combination of TC1 vs R1, TC1 vs R2 and so on.

When a user clicks on any of the cell with value as Fail.
I need to retrieve the value of the </brow and column number of that cell. This click could be on any call with value as Fail.

I need the row and column values to do further calculations

推荐答案

检查这些链接..

来自javascript的表格单元格 [如何访问行列html表 [ ^ ]

访问表格单元内容Firefox [ ^ ]

编写上面链接中讨论的javascript函数,并从Table单元格的OnClick事件中调用该函数.

check these links..

tables cell from javascript[^]

how do you access rows columns html table[^]

access Table cells content Firefox[^]

write the javascript function discussed in above links and call that function from OnClick event of Table cell.

<table><tr><td id="tdid"  önclick="funcName()"></td></tr></table>



希望对您有所帮助.



hope it helps.


请尝试以下示例...


try following sample...


<?xml version="1.0" encoding="UTF-8"?>

<html>
  <head>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  </head>
<body>

  <script type="text/javascript">


(文档).ready(function(){
(document).ready(function() {


这篇关于如何确定html表格中单元格的行号和库仑数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆