简体   繁体   English

Javascript:获取单元格的列ID

[英]Javascript: Get cell's column id

For example: 例如:

I want to accomplish what the following psuedo code does 我想完成以下伪代码的工作

<scipt>
var intCol = document.getElementById('x').column
</scipt>

Is there a way to do this? 有没有办法做到这一点?

Why can't you use cellIndex ? 为什么不能使用cellIndex

On this page: 在此页:

$('.postcell')[0].cellIndex
> 1
$('.votecell')[0].cellIndex
> 0

I know people hate W3Schools, but they do provide a good basic dataset: http://www.w3schools.com/jsref/prop_tabledata_cellindex.asp 我知道人们讨厌W3School,但是他们确实提供了很好的基本数据集: http : //www.w3schools.com/jsref/prop_tabledata_cellindex.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM