jQuery - 如何使用选择器在表格中查找特定单元格?

Posted

技术标签:

【中文标题】jQuery - 如何使用选择器在表格中查找特定单元格?【英文标题】:jQuery - how to find specific cell in a table using selectors? 【发布时间】:2014-11-14 15:22:48 【问题描述】:

鉴于每个单元格都有 row, col 属性。 我试过类似的东西

$(#mytable tr td row=1 col=1)

但它不起作用

【问题讨论】:

你的意思是$(#mytable tr:eq(0) td:eq(0) 【参考方案1】:

您可以使用first-childnth-child。例如:

$("#mytable tr:first-child td:first-child")

$("#mytable tr:nth-child(1) td:nth-child(1)")

【讨论】:

以上是关于jQuery - 如何使用选择器在表格中查找特定单元格?的主要内容,如果未能解决你的问题,请参考以下文章