jason m
jason m

Reputation: 6835

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?

Upvotes: 1

Views: 2056

Answers (1)

josh.trow
josh.trow

Reputation: 4901

Why can't you use 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

Upvotes: 1

Related Questions