I have multiple column headers that spans of multiple column and I would like to find the correct header number/count for the columns.
I want to enter a column numbe
That's easy, as long as you don't have any rowspans:
rowspan
function getCell(tr, col) { var cell = tr.firstElementChild; while (cell && (col -= cell.colSpan || 1)>=0) cell = cell.nextElementSibling; return cell; }
See demonstration.