jquery table offsetWidth question -


i have been looking hours , can't figure out.
trying write code align table headers , table columns,
trying figure out overall width of header cell , width of column.
strange reason tdoffset gets value , thoffset nan.

$("#tbltasks tbody tr:eq(0) td").each(function(index) {     tdoffset = parseint(this.offsetwidth);      thel = $('#tbltasks thead tr:eq(0) th:eq(' + index.tostring() + ')').first();     thoffset = parseint(thel.offsetwidth);      alert('tdoffset' + tdoffset + ' thoffset:' + thoffset); } 

can point out doing wrong?

thanks , happy.

the reason this.offsetwidth works , thel.offsetwidth not this refers dom element , thel refers jquery object.

you can access dom element "behind" thoffset doing following

thel[0].offsetwidth 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -