I studied this for several hours and cannot understand.
I am trying to write code to align table headers and table columns.
I am trying to figure out the total width of the header cell and the width of the column.
but for some strange reason it tdOffsetgets the value, and 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 someone point out what I'm doing wrong?
Thank you and be happy.
user425445
source
share