【问题标题】:jQuery - how to find specific cell in a table using selectors?jQuery - 如何使用选择器在表格中查找特定单元格?
【发布时间】:2026-01-11 09:45:01
【问题描述】:

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

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

但它不起作用

【问题讨论】:

  • 你的意思是$(#mytable tr:eq(0) td:eq(0)

标签: jquery html-table jquery-selectors row col


【解决方案1】:

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

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

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

【讨论】: